本文整理汇总了PHP中Scalr::initializeContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP Scalr::initializeContainer方法的具体用法?PHP Scalr::initializeContainer怎么用?PHP Scalr::initializeContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scalr
的用法示例。
在下文中一共展示了Scalr::initializeContainer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
define("CACHEPATH", "{$base}/../cache");
define("SCALR_CONFIG_FILE", APPPATH . '/etc/config.yml');
define("SCALR_CONFIG_CACHE_FILE", CACHEPATH . '/.config');
define("SCALR_VERSION", trim(@file_get_contents(APPPATH . "/etc/version")));
$ADODB_CACHE_DIR = CACHEPATH . "/adodb";
define("SCALR_TEMPLATES_PATH", APPPATH . "/templates/en_US");
// Require autoload definition
$classpath[] = $base;
$classpath[] = $base . "/externals/ZF-1.10.8";
$classpath[] = $base . "/externals/google-api-php-client-git-03102014/src";
set_include_path(get_include_path() . PATH_SEPARATOR . join(PATH_SEPARATOR, $classpath));
require_once SRCPATH . "/autoload.inc.php";
spl_autoload_register("__autoload");
set_error_handler("Scalr::errorHandler");
//Container witn adodb service needs to be defined in the first turn, as much depends on it.
Scalr::initializeContainer();
$idFilePath = APPPATH . '/etc/id';
$id = trim(@file_get_contents($idFilePath));
if (!$id) {
$uuid = Scalr::GenerateUID();
$id = dechex(abs(crc32($uuid)));
$res = @file_put_contents($idFilePath, $id);
if (!$res) {
exit("ERROR: Unable to write ID file ({$idFilePath}).");
}
}
define("SCALR_ID", $id);
// Define log4php contants
define("LOG4PHP_DIR", SRCPATH . '/externals/apache-log4php-2.0.0-incubating/src/main/php');
require_once LOG4PHP_DIR . '/Logger.php';
require_once SRCPATH . '/externals/adodb5-18/adodb-exceptions.inc.php';