예제 #1
0
파일: AutoBuild.php 프로젝트: unu/autobuild
 public static function watch($compilers)
 {
     self::$watching = true;
     if (isset($_GET['autobuild'])) {
         if (!$_GET['autobuild']) {
             header('content-type: text/javascript');
             die(require __DIR__ . '/autobuild.js');
         } else {
             self::runWatch($compilers, $_GET['autobuild']);
             die;
         }
     }
 }
예제 #2
0
파일: autobuild.php 프로젝트: unu/autobuild
<?php

require_once __DIR__ . '/../vendor/autoload.php';
$scssBuilder = new AutoBuildScss(__DIR__ . '/scss/style.scss', __DIR__ . '/cache/style.css', glob(__DIR__ . '/scss/*.scss'));
$reloader = new AutoBuildReloader(glob(__DIR__ . '/*.{php,js,html}', GLOB_BRACE));
$dev = in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']);
if ($dev) {
    AutoBuild::watch([$scssBuilder, $reloader]);
} else {
    $scssBuilder();
}
예제 #3
0
파일: index.php 프로젝트: unu/autobuild
<?php

require __DIR__ . '/autobuild.php';
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>AutoBuild Test</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="cache/style.css">
	</head>
	<body>
		<h1>AutoBuild.</h1>

		<?php 
echo AutoBuild::script();
?>
	</body>
</html>