whoops! forgot to add the toolkit, forgot a quote, and messed up verbosity comparison.

This commit is contained in:
florian
2013-10-05 15:48:03 +00:00
parent e0da46edca
commit 00252a4bab
2 changed files with 27 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ require_once("toolkit.php");
$cake_api = file_get_contents("https://github.com/cakephp/cakephp/tags");
if( preg_match("/\<span class=\"tag\-name\"\>([0-9\.]+)\<\/span\>/", $cake_api, $matches) ) {
$cake_current = $matches[1];
verbose(Current CakePHP version: $cake_current", 1);
verbose("Current CakePHP version: $cake_current", 1);
}else {
die("Unable to determine current CakePHP version, exiting\n");
}

26
run.d/toolkit.php Normal file
View File

@@ -0,0 +1,26 @@
<?
// Generic tasks to read shell/environment settings into PHP
//
// Environment CHK_HOSTS holds hosts to check, get them in an array
//
if( getenv('CHK_HOSTS') == null ) {
$hosts = null;
}else {
$hosts = explode(' ', getenv('CHK_HOSTS'));
if (implode($hosts)=='') die("No hosts to check.\n");
}
// Verbosity settings
//
if( getenv('VERBOSE') == null ) {
$verbose = 0;
} else {
$verbose = getenv('VERBOSE');
}
function verbose($msg, $loglevel=0) {
global $verbose;
if($loglevel <= $verbose) echo $msg."\n";
}
?>