= 0)) {
die('Organizr needs PHP Version: ' . $GLOBALS['minimumPHP'] . '
You have PHP Version: ' . PHP_VERSION);
}
// Set GLOBALS from config file
$GLOBALS['userConfigPath'] = dirname(__DIR__, 1) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
$GLOBALS['defaultConfigPath'] = dirname(__DIR__, 1) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'default.php';
$GLOBALS['currentTime'] = gmdate("Y-m-d\TH:i:s\Z");
// Quick function for plugins
function pluginFiles($type)
{
$files = '';
switch ($type) {
case 'js':
foreach (glob(dirname(__DIR__, 1) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . "*.js") as $filename) {
$files .= '';
}
break;
case 'css':
foreach (glob(dirname(__DIR__, 1) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . "*.js") as $filename) {
$files .= '';
}
break;
default:
break;
}
return $files;
}
function loadConfigOnce($path = null)
{
$path = ($path) ? $path : $GLOBALS['userConfigPath'];
if (!is_file($path)) {
return null;
} else {
return (array)call_user_func(function () use ($path) {
return include($path);
});
}
}
function favIcons()
{
$favicon = '
';
if (file_exists($GLOBALS['userConfigPath'])) {
$config = loadConfigOnce($GLOBALS['userConfigPath']);
if (isset($config['favIcon'])) {
if ($config['favIcon'] !== '') {
$favicon = $config['favIcon'];
}
}
}
return $favicon;
}