/** * Initialize variables that require some dynamic processing. * * @since 2.0 * @return void */ public static function init() { if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); } if (self::$documentRoot === null) { self::$documentRoot = rtrim(realpath(preg_replace('`' . preg_quote($_SERVER['PHP_SELF']) . '$`', '', $_SERVER['SCRIPT_FILENAME'])), '/'); } if (self::$pathToSLIR === null) { self::$pathToSLIR = realpath(__DIR__ . '/../'); } if (self::$pathToCacheDir === null) { self::$pathToCacheDir = self::$pathToSLIR . '/cache'; } if (self::$pathToErrorLog === null) { self::$pathToErrorLog = self::$pathToSLIR . '/slir-error-log'; } }
/** * Initialize variables that require some dynamic processing. * * @since 2.0 * @return void */ public static function init() { if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); } if (self::$documentRoot === null) { self::$documentRoot = $_SERVER['DOCUMENT_ROOT']; } if (self::$pathToSLIR === null) { self::$pathToSLIR = realpath(__DIR__ . '/../'); } if (self::$pathToCacheDir === null) { self::$pathToCacheDir = self::$pathToSLIR . '/cache'; } if (self::$pathToErrorLog === null) { self::$pathToErrorLog = self::$pathToSLIR . '/slir-error-log'; } }