Example #1
0
    print_fail("You need to run this script as root");
}
// load config.php now
require_once 'includes/defaults.inc.php';
require_once 'config.php';
// make sure install_dir is set correctly, or the next includes will fail
if (!file_exists($config['install_dir'] . '/config.php')) {
    print_fail('$config[\'install_dir\'] is not set correctly.  It should probably be set to: ' . getcwd());
    exit;
}
// continue loading includes
require_once 'includes/definitions.inc.php';
require_once 'includes/functions.php';
require_once 'includes/common.php';
require_once $config['install_dir'] . '/includes/alerts.inc.php';
$versions = version_info();
echo "Version info:\n";
$cur_sha = $versions['local_sha'];
if ($config['update_channel'] == 'master' && $cur_sha != $versions['github']['sha']) {
    $commit_date = new DateTime($versions['local_date']);
    $commit_date->setTimezone(new DateTimeZone(date_default_timezone_get()));
    print_warn("Your install is out of date: {$cur_sha} " . $commit_date->format('(r)'));
} else {
    echo "Commit SHA: {$cur_sha}\n";
}
if ($versions['local_branch'] != 'master') {
    print_warn("Your local git branch is not master, this will prevent automatic updates.");
}
// check for modified files
$modifiedcmd = 'git diff --name-only --exit-code';
if ($username === 'root') {
Example #2
0
 private function _version($params)
 {
     $versions = version_info(false);
     $schema_version = $versions['db_schema'];
     $version = substr($versions['local_sha'], 0, 7);
     $msg = $this->config['project_name_version'] . ', Version: ' . $version . ', DB schema: #' . $schema_version . ', PHP: ' . PHP_VERSION;
     return $this->respond($msg);
 }
Example #3
0
}
function version_info($proname, $subver, $ver, $supver, $reltype, $svnver, $showsvn)
{
    $return_var = $proname . " " . $reltype . " " . $subver . "." . $ver . "." . $supver;
    if ($showsvn == false) {
        $showsvn = null;
    }
    if ($showsvn == true) {
        $return_var .= " SVN " . $svnver;
    }
    if ($showsvn != true && $showsvn != null) {
        $return_var .= " " . $showsvn . " " . $svnver;
    }
    return $return_var;
}
$appversion = version_info($appname, $appver[0], $appver[1], $appver[2], $appver[3] . " Ver.", null, false);
if (!isset($_GET['redirect'])) {
    $_GET['redirect'] = "off";
}
/**
 * Returns true if $string is valid UTF-8 and false otherwise.
 *
 * @since        1.14
 * @param [mixed] $string     string to be tested
 * @subpackage
 */
function is_utf8($string)
{
    // From http://w3.org/International/questions/qa-forms-utf-8.html
    return preg_match('%^(?:
              [\\x09\\x0A\\x0D\\x20-\\x7E]            # ASCII
Example #4
0
    }
    if (isset($iDBAltName['VerCheckURL'])) {
        $Settings['VerCheckURL'] = $iDBAltName['VerCheckURL'];
    }
}
if (isset($Settings['usealtname']) && $Settings['usealtname'] == "yes") {
    $RName = $AltName2;
    $SFName = $AltName;
    $RFullName = $AltFullName;
    $VerCheckName = $AltVerCheckName;
    $UserAgentName = $AltUserAgentName;
}
$VerInfo['iDB_Ver'] = version_info($RName, $VER1[0], $VER1[1], $VER1[2], $VER2[1], $SubVerN, false);
$VerInfo['iDB_Ver_SVN'] = version_info($RName, $VER1[0], $VER1[1], $VER1[2], $VER2[1], $SubVerN, $VER2[2]);
$VerInfo['iDB_Full_Ver'] = version_info($RName, $VER1[0], $VER1[1], $VER1[2], $VER2[0], $SubVerN, false);
$VerInfo['iDB_Full_Ver_SVN'] = version_info($RName, $VER1[0], $VER1[1], $VER1[2], $VER2[0], $SubVerN, $VER2[2]);
$VerInfo['iDB_Ver_Show'] = $VerInfo['iDB_Ver_SVN'];
$VerInfo['iDB_Full_Ver_Show'] = $VerInfo['iDB_Full_Ver_SVN'];
define("_iDB_Ver_", $VerInfo['iDB_Ver']);
define("_iDB_Ver_SVN_", $VerInfo['iDB_Ver_SVN']);
define("_iDB_Full_Ver_", $VerInfo['iDB_Full_Ver']);
define("_iDB_Full_Ver_SVN_", $VerInfo['iDB_Full_Ver_SVN']);
define("_iDB_Ver_Show_", $VerInfo['iDB_Ver_Show']);
define("_iDB_Full_Ver_Show_", $VerInfo['iDB_Full_Ver_Show']);
/* 
URLs and names and stuff. :P 
$KSP = "Kazuki Sabonis Przyborowski";
$KSPAlt = "Kazuki Suzuki Przyborowski";
*/
$iDBHome = "http://ja.gamemaker2k.org/";
$iDBHome = "http://df2k.gamemaker2k.org/";
Example #5
0
 *
 * @package    observium
 * @subpackage poller
 * @author     Adam Armstrong <*****@*****.**>
 * @copyright  (C) 2006 - 2012 Adam Armstrong
 */
chdir(dirname($argv[0]));
require 'includes/defaults.inc.php';
require 'config.php';
require 'includes/definitions.inc.php';
require 'includes/functions.php';
require 'includes/polling/functions.inc.php';
require 'includes/alerts.inc.php';
$poller_start = microtime(true);
echo $config['project_name_version'] . " Poller\n";
$versions = version_info(false);
echo "Version info:\n";
$cur_sha = $versions['local_sha'];
echo "Commit SHA: {$cur_sha}\n";
echo "DB Schema: " . $versions['db_schema'] . "\n";
echo "PHP: " . $versions['php_ver'] . "\n";
echo "MySQL: " . $versions['mysql_ver'] . "\n";
echo "RRDTool: " . $versions['rrdtool_ver'] . "\n";
echo "SNMP: " . $versions['netsnmp_ver'] . "\n";
$options = getopt('h:m:i:n:r::d::a::f::');
if ($options['h'] == 'odd') {
    $options['n'] = '1';
    $options['i'] = '2';
} else {
    if ($options['h'] == 'even') {
        $options['n'] = '0';