22 public static function start(
int $port=35729):string{
25 return '<script'.$nonce.
'>document.write(\'<script'.$nonce.
' src="http://\' + (location.host || \'localhost\').split(\':\')[0] +
26 \':' . $port .
'/livereload.js?snipver=1"></\' + \'script>\')</script>';
36 \exec(
'livereload --version', $_, $exitCode);
37 return $exitCode == 1;
40 private static function getNonce($name=
'jsUtils'){
41 if(\class_exists(
'\\Ubiquity\\security\\csp\\ContentSecurityManager')){
42 if (\
Ubiquity\security\csp\ContentSecurityManager::hasNonce($name)){
43 $nonce=\Ubiquity\security\csp\ContentSecurityManager::getNonce($name);
44 return " nonce=\"$nonce\" ";
Class for livereload in dev mode.
static hasLiveReload()
Check if Livereload js intallation.
static start(int $port=35729)
Add livereload webSocket.
static getNonce($name='jsUtils')
Http Request utilities, wrapper for accessing to $_GET, $_POST and php://input.
Class Configuration \config.