Ejemplo n.º 1
0
 public static function getStartables()
 {
     if (is_null(self::$startables) || !is_array(self::$startables)) {
         self::$startables = array();
         QueryBuilder::create(SQL::getConnection())->withQuery("SELECT id, display_name, folder_name, executable FROM websites")->build()->forEachResult(function ($row) {
             self::$startables[] = new Startables($row['id'], $row['display_name'], $row['folder_name'], $row['executable']);
         });
         if (count(self::$startables) == 0) {
             throw new Exception("lol");
         }
     }
     return self::$startables;
 }
Ejemplo n.º 2
0
 function echoStart(Startables $starter)
 {
     echo $starter->getName() . ":\r\n";
     echo $starter->start() . "\r\n";
 }
Ejemplo n.º 3
0
\t\t\t<h1>Painan's Updater</h1>
\t\t</div>
\t\t<div class="buttons">
\t\t<div class="button button-website" data-site="-1">ALL SITES</div>
EOL;
    foreach (Website::getAllWebsites() as $site) {
        echo "<div class='button button-website' data-site='{$site->getId()}'>{$site->getName()}</div>";
    }
} else {
    echo <<<EOL
\t\t<div class="page-title">
\t\t\t<h1>Painan's Starter</h1>
\t\t</div>
\t\t<div class="buttons">
EOL;
    foreach (Startables::getStartables() as $starter) {
        echo "<div class='button button-startable' data-startable='{$starter->getId()}'>{$starter->getName()}</div>";
    }
}
?>
		</div>
		<div class="spacer"></div>

		<pre class="console">
Hi. Welcome to Painan.
		</pre>

	</div>
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
	<script src="./js/scripts.js"></script>
</body>