本文整理汇总了PHP中KalturaLog::initLog方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaLog::initLog方法的具体用法?PHP KalturaLog::initLog怎么用?PHP KalturaLog::initLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaLog
的用法示例。
在下文中一共展示了KalturaLog::initLog方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InitLogger
/**
* @param $configName string
* @param $context string
*/
public static function InitLogger($configName, $context = null)
{
if (KalturaLog::getLogger()) {
// already initialized
return;
}
if (function_exists('apc_fetch')) {
$cacheKey = self::LOGGER_APC_CACHE_KEY_PREFIX . $configName;
$logger = apc_fetch($cacheKey);
if ($logger) {
list($logger, $cacheVersionId) = $logger;
if ($cacheVersionId == kConf::getCachedVersionId()) {
KalturaLog::setLogger($logger);
return;
}
}
}
try {
$config = new Zend_Config(kConf::getMap('logger'));
KalturaLog::initLog($config->{$configName});
if ($context) {
KalturaLog::setContext($context);
}
if (function_exists('apc_store')) {
apc_store($cacheKey, array(KalturaLog::getLogger(), kConf::getCachedVersionId()));
}
} catch (Zend_Config_Exception $ex) {
}
}
示例2: _initLog
protected function _initLog()
{
$this->bootstrap('autoloaders');
$this->bootstrap('config');
$config = Zend_Registry::get('config');
KalturaLog::initLog($config->logger);
KalturaLog::debug('starting request');
}
示例3: _initLog
protected function _initLog()
{
$this->bootstrap('config');
$this->bootstrap('autoloaders');
$this->bootstrap('timezone');
$loggerConfigPath = realpath(APPLICATION_PATH . '/../configurations/logger.ini');
$loggerConfig = new Zend_Config_Ini($loggerConfigPath);
$configSettings = Zend_Registry::get('config')->settings;
$loggerName = $configSettings->loggerName;
$appLogger = $loggerConfig->get($loggerName);
KalturaLog::initLog($appLogger);
KalturaLog::debug('starting request');
}
示例4: _initLog
protected function _initLog()
{
$this->bootstrap('autoloaders');
$this->bootstrap('timezone');
$config = $this->getConfig();
$configSettings = $config->settings;
$loggerConfigPath = null;
if (isset($configSettings->loggerConfigPath)) {
$loggerConfigPath = $configSettings->loggerConfigPath;
} else {
$loggerConfigPath = realpath(APPLICATION_PATH . '/../configurations/logger.ini');
}
$loggerConfig = new Zend_Config_Ini($loggerConfigPath);
$loggerName = $configSettings->applicationName;
$appLogger = $loggerConfig->get($loggerName);
KalturaLog::initLog($appLogger);
}
示例5: chdir
<?php
/**
*
* @package Scheduler
*/
chdir(__DIR__);
define('KALTURA_ROOT_PATH', realpath(__DIR__ . '/../'));
require_once KALTURA_ROOT_PATH . '/alpha/config/kConf.php';
define("KALTURA_BATCH_PATH", KALTURA_ROOT_PATH . "/batch");
// Autoloader - override the autoloader defaults
require_once KALTURA_ROOT_PATH . "/infra/KAutoloader.php";
KAutoloader::setClassPath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"), KAutoloader::buildPath(KALTURA_BATCH_PATH, "*")));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*", "batch", "*"));
KAutoloader::setIncludePath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "library")));
KAutoloader::setClassMapFilePath(kEnvironment::get("cache_root_path") . '/batch/classMap.cache');
KAutoloader::register();
// Logger
$loggerConfigPath = KALTURA_ROOT_PATH . "/configurations/logger.ini";
try {
$config = new Zend_Config_Ini($loggerConfigPath);
KalturaLog::initLog($config->batch_scheduler);
KalturaLog::setContext("BATCH");
} catch (Zend_Config_Exception $ex) {
}
示例6: define
<?php
/**
*
* @package Scheduler
*/
require_once "../infra/bootstrap_base.php";
require_once KALTURA_ROOT_PATH . '/alpha/config/kConf.php';
define("KALTURA_BATCH_PATH", KALTURA_ROOT_PATH . "/batch");
// Autoloader - override the autoloader defaults
require_once KALTURA_INFRA_PATH . "/KAutoloader.php";
KAutoloader::setClassPath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"), KAutoloader::buildPath(KALTURA_BATCH_PATH, "*")));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*", "batch", "*"));
KAutoloader::setIncludePath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "library")));
KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/batch/classMap.cache');
KAutoloader::register();
// Logger
$loggerConfigPath = KALTURA_BATCH_PATH . "/logger.ini";
try {
$config = new Zend_Config_Ini($loggerConfigPath);
} catch (Zend_Config_Exception $ex) {
$config = null;
}
KalturaLog::initLog($config);
KalturaLog::setContext("BATCH");
示例7: chdir
<?php
/**
*
* @package Scheduler
*/
chdir(__DIR__);
define('KALTURA_ROOT_PATH', realpath(__DIR__ . '/../'));
require_once KALTURA_ROOT_PATH . '/alpha/config/kConf.php';
define("KALTURA_BATCH_PATH", KALTURA_ROOT_PATH . "/batch");
// Autoloader - override the autoloader defaults
require_once KALTURA_ROOT_PATH . "/infra/KAutoloader.php";
KAutoloader::setClassPath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"), KAutoloader::buildPath(KALTURA_BATCH_PATH, "*")));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*", "batch", "*"));
KAutoloader::setIncludePath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "library")));
KAutoloader::setClassMapFilePath(kEnvironment::get("cache_root_path") . '/batch/classMap.cache');
KAutoloader::addExcludePath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "aws", "*"));
// Do not load AWS files
KAutoloader::addExcludePath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "HTMLPurifier", "*"));
// Do not load HTMLPurifier files
KAutoloader::register();
// Logger
$loggerConfigPath = KALTURA_ROOT_PATH . "/configurations/logger.ini";
try {
$config = new Zend_Config_Ini($loggerConfigPath);
KalturaLog::initLog($config->batch);
KalturaLog::setContext("BATCH");
} catch (Zend_Config_Exception $ex) {
}
示例8: set_include_path
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "base", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "lib", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "api", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "common", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "unitTests", "*"));
set_include_path(get_include_path() . PATH_SEPARATOR . KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "phpseclib"));
//$paths = explode(PATH_SEPARATOR, get_include_path());
//foreach($paths as $path)
// KAutoloader::addClassPath(KAutoloader::buildPath($path, "*"));
KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/tests/classMap.cache');
//KAutoloader::dumpExtra();
KAutoloader::register();
// Timezone
$timeZone = kConf::get("date_default_timezone");
$isTimeZone = substr_count($timeZone, '@') == 0;
//no @ in a real time zone
if ($isTimeZone) {
date_default_timezone_set($timeZone);
}
// America/New_York
// Logger
$loggerConfigPath = KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'configurations' . DIRECTORY_SEPARATOR . "logger.ini";
try {
$config = new Zend_Config_Ini($loggerConfigPath);
KalturaLog::initLog($config->tests);
KalturaLog::setContext("tests");
} catch (Zend_Config_Exception $ex) {
}
// set DB
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
示例9: rotateLog
/**
*
* Rotates the log into the new file
*/
private function rotateLog()
{
$this->currentlogNumber++;
try {
$dirname = dirname(__FILE__);
$logFilePath = "{$this->logFileName}.{$this->currentlogNumber}";
$config = new Zend_Config_Ini("{$dirname}/logger.ini");
$config->writers->stream->stream = $logFilePath;
} catch (Zend_Config_Exception $ex) {
$config = null;
}
KalturaLog::initLog($config);
}
示例10: checkCache
}
die;
}
}
}
}
}
checkCache();
require_once realpath(dirname(__FILE__)) . '/../config/sfrootdir.php';
define('SF_APP', 'kaltura');
define('SF_ENVIRONMENT', 'prod');
define('SF_DEBUG', false);
define('MODULES', SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . "modules" . DIRECTORY_SEPARATOR);
require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
// Logger
$loggerConfigPath = realpath(dirname(__FILE__) . "/../../configurations/logger.ini");
try {
$config = new Zend_Config_Ini($loggerConfigPath);
$ps2 = $config->ps2;
KalturaLog::initLog($ps2);
KalturaLog::setContext('PS2');
} catch (Zend_Config_Exception $ex) {
$config = null;
}
sfLogger::getInstance()->registerLogger(KalturaLog::getInstance());
sfLogger::getInstance()->setLogLevel(7);
sfConfig::set('sf_logging_enabled', true);
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
ActKeyUtils::checkCurrent();
sfContext::getInstance()->getController()->dispatch();
示例11: date_default_timezone_set
require_once KALTURA_API_PATH . DIRECTORY_SEPARATOR . 'VERSION.php';
//defines KALTURA_API_VERSION
require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'infra' . DIRECTORY_SEPARATOR . 'kConf.php';
require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
// Autoloader
require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php";
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "lib", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "services", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "plugins", "*"));
// needed for testmeDoc
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator"));
// needed for testmeDoc
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "utils", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "thumbnailMaker", "*"));
KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/api_v3/classMap.cache');
//KAutoloader::dumpExtra();
KAutoloader::register();
// Timezone
date_default_timezone_set(kConf::get("date_default_timezone"));
// America/New_York
// Logger
$loggerConfigPath = realpath(KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "configurations" . DIRECTORY_SEPARATOR . "logger.ini");
try {
$config = new Zend_Config_Ini($loggerConfigPath);
$api_v3 = $config->api_v3;
KalturaLog::initLog($api_v3);
} catch (Zend_Config_Exception $ex) {
$config = null;
}
示例12: set_time_limit
<?php
set_time_limit(0);
ini_set("memory_limit", "2048M");
define('ROOT_DIR', realpath(dirname(__FILE__) . '/../'));
require_once ROOT_DIR . '/infra/kConf.php';
require_once ROOT_DIR . '/infra/bootstrap_base.php';
require_once ROOT_DIR . '/infra/KAutoloader.php';
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "api_v3", "lib", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "admin_console", "lib", "Kaltura", "*"));
KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/deploy/classMap.cache');
KAutoloader::register();
date_default_timezone_set(kConf::get("date_default_timezone"));
// America/New_York
$loggerConfigPath = realpath(KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "configurations" . DIRECTORY_SEPARATOR . "logger.ini");
try {
$config = new Zend_Config_Ini($loggerConfigPath);
$deploy = $config->deploy;
KalturaLog::initLog($deploy);
} catch (Zend_Config_Exception $ex) {
}
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
示例13: define
<?php
require_once ".." . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "bootstrap_base.php";
require_once ".." . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "kConf.php";
define("KALTURA_API_PATH", KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "api_v3");
define("KALTURA_PLUGIN_PATH", KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "plugins");
define("KALTURA_GENERATOR_PATH", KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "generator");
require_once KALTURA_API_PATH . DIRECTORY_SEPARATOR . 'VERSION.php';
//defines KALTURA_API_VERSION
// Autoloader
require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php";
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "lib", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "services", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "plugins", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_PLUGIN_PATH, "*"));
KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/generator/classMap.cache');
KAutoloader::register();
// Timezone
date_default_timezone_set(kConf::get("date_default_timezone"));
// America/New_York
// Logger
$loggerConfigPath = KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'configurations' . DIRECTORY_SEPARATOR . "logger.ini";
try {
$config = new Zend_Config_Ini($loggerConfigPath);
KalturaLog::initLog($config->generator);
KalturaLog::setContext("GENERATOR");
} catch (Zend_Config_Exception $ex) {
}