当前位置: 首页>>代码示例>>PHP>>正文


PHP KalturaLog::setContext方法代码示例

本文整理汇总了PHP中KalturaLog::setContext方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaLog::setContext方法的具体用法?PHP KalturaLog::setContext怎么用?PHP KalturaLog::setContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KalturaLog的用法示例。


在下文中一共展示了KalturaLog::setContext方法的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) {
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:33,代码来源:kLoggerCache.php

示例2: 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) {
}
开发者ID:DBezemer,项目名称:server,代码行数:25,代码来源:bootstrap_scheduler.php

示例3: toArrayRecursive

<?php

require_once "../../bootstrap.php";
KalturaLog::setContext("TESTME");
$service = $_GET["service"];
$action = $_GET["action"];
$bench_start = microtime(true);
KalturaLog::INFO(">------- api_v3 testme [{$service}][{$action}]-------");
function toArrayRecursive(KalturaPropertyInfo $propInfo)
{
    return $propInfo->toArray();
}
$serviceMap = KalturaServicesMap::getMap();
$actionInfo = null;
try {
    $serviceReflector = $serviceMap[strtolower($service)];
    /* @var $serviceReflector KalturaServiceActionItem */
    $actionReflector = new KalturaActionReflector($service, $action, $serviceReflector->actionMap[$action]);
    $actionParams = $actionReflector->getActionParams();
    $actionInfo = $actionReflector->getActionInfo();
    $actionInfo = array("actionParams" => array(), "description" => $actionInfo->description);
    foreach ($actionParams as $actionParam) {
        $actionInfo["actionParams"][] = toArrayRecursive($actionParam);
    }
} catch (Exception $ex) {
    KalturaLog::ERR("<------- api_v3 testme [{$service}][{$action}\n" . $ex->__toString() . " " . " -------");
}
//echo "<pre>";
//echo print_r($actionInfo);
echo json_encode($actionInfo);
$bench_end = microtime(true);
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:ajax-get-action-info.php

示例4: microtime

<?php

$start = microtime(true);
set_time_limit(0);
require_once dirname(__FILE__) . '/../../alpha/config/sfrootdir.php';
// check cache before loading anything
require_once "../lib/KalturaResponseCacher.php";
$cache = new KalturaResponseCacher(null, "/web/cache/feed/", 86400);
$cache->checkOrStart();
require_once "../bootstrap.php";
KalturaLog::setContext("syndicationFeedRenderer");
KalturaLog::debug(">------------------------------------- syndicationFeedRenderer -------------------------------------");
KalturaLog::info("syndicationFeedRenderer-start ");
$feedId = $_GET['feedId'];
$entryId = @$_GET['entryId'];
try {
    $syndicationFeedRenderer = new KalturaSyndicationFeedRenderer($feedId);
    $syndicationFeedRenderer->addFlavorParamsAttachedFilter();
    if (isset($entryId)) {
        $syndicationFeedRenderer->addEntryAttachedFilter($entryId);
    }
    $syndicationFeedRenderer->execute();
} catch (Exception $ex) {
    header('KalturaSyndication: ' . $ex->getMessage());
    die;
}
$end = microtime(true);
KalturaLog::info("syndicationFeedRenderer-end [" . ($end - $start) . "]");
KalturaLog::debug("<------------------------------------- syndicationFeedRenderer -------------------------------------");
$cache->end();
开发者ID:richhl,项目名称:kalturaCE,代码行数:30,代码来源:getFeed.php

示例5: isset

<?php

require_once ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "bootstrap.php";
KalturaLog::setContext("CLIENTS");
KalturaLog::debug(__FILE__ . " start");
$requestedName = isset($_GET["name"]) ? $_GET['name'] : null;
if (!$requestedName) {
    die("File not found");
}
$generatorOutputPath = KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator", "output");
$generatorConfigPath = KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator", "config.ini");
$config = new Zend_Config_Ini($generatorConfigPath);
foreach ($config as $name => $item) {
    if ($name === $requestedName && $item->get("public-download")) {
        $fileName = $name . ".tar.gz";
        $outputFilePath = KAutoloader::buildPath($generatorOutputPath, $fileName);
        $outputFilePath = realpath($outputFilePath);
        header("Content-disposition: attachment; filename={$fileName}");
        kFile::dumpFile($outputFilePath, "application/gzip");
        die;
    }
}
die("File not found");
KalturaLog::debug(__FILE__ . " end");
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:24,代码来源:download.php

示例6: microtime

<?php

$start = microtime(true);
require_once dirname(__FILE__) . '/../../alpha/config/sfrootdir.php';
// check cache before loading anything
require_once "../lib/KalturaResponseCacher.php";
$cache = new KalturaResponseCacher();
$cache->checkOrStart();
require_once "../bootstrap.php";
ActKeyUtils::checkCurrent();
KalturaLog::setContext("API");
KalturaLog::debug(">------------------------------------- api_v3 -------------------------------------");
KalturaLog::info("API-start ");
$controller = KalturaFrontController::getInstance();
$controller->run();
$end = microtime(true);
KalturaLog::info("API-end [" . ($end - $start) . "]");
KalturaLog::debug("<------------------------------------- api_v3 -------------------------------------");
$cache->end();
开发者ID:richhl,项目名称:kalturaCE,代码行数:19,代码来源:index.php

示例7: error_reporting

error_reporting(E_ALL);
set_time_limit(0);
ini_set("memory_limit", "700M");
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';
require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"));
KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/scripts/' . basename(__FILE__) . '.cache');
KAutoloader::register();
date_default_timezone_set(kConf::get("date_default_timezone"));
$loggerConfigPath = ROOT_DIR . '/scripts/logger.ini';
$config = new Zend_Config_Ini($loggerConfigPath);
KalturaLog::initLog($config);
KalturaLog::setContext(basename(__FILE__));
KalturaLog::info("Starting script");
KalturaLog::info("Initializing database...");
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
KalturaLog::info("Database initialized successfully");
$syncType = 'kuser';
$dbh = myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_DWH);
$sql = "CALL get_data_for_operational('{$syncType}')";
$count = 0;
$rows = $dbh->query($sql)->fetchAll();
foreach ($rows as $row) {
    $kuser = kuserPeer::retrieveByPK($row['kuser_id']);
    if (is_null($kuser)) {
        KalturaLog::err('Couldn\'t find kuser [' . $row['kuser_id'] . ']');
        continue;
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:updateKuserFromDWH.php

示例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();
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:bootstrap.php

示例9: define

require_once ".." . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "bootstrap_base.php";
require_once ".." . DIRECTORY_SEPARATOR . "alpha" . DIRECTORY_SEPARATOR . "config" . 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_GENERATOR_PATH . DIRECTORY_SEPARATOR . "logger.ini";
try {
    $config = new Zend_Config_Ini($loggerConfigPath);
} catch (Zend_Config_Exception $ex) {
    $config = null;
}
KalturaLog::initLog($config);
KalturaLog::setContext("GENERATOR");
开发者ID:richhl,项目名称:kalturaCE,代码行数:29,代码来源:bootstrap.php

示例10: dirname

<?php

require_once dirname(__FILE__) . "/../../infra/bootstrap_base.php";
require_once KALTURA_ROOT_PATH . '/alpha/config/kConf.php';
define("KALTURA_TEST_PATH", KALTURA_ROOT_PATH . "/tests/base");
// Autoloader - override the autoloader defaults
require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php";
KAutoloader::setClassPath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "lib", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "apps", "kaltura", "lib", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "tests", "base", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "tests", "api", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "tests", "lib", "*")));
KAutoloader::setIncludePath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "library")));
KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/unitTest_api/classMap.cache');
KAutoloader::register();
// Timezone
date_default_timezone_set(kConf::get("date_default_timezone"));
// America/New_York
// Logger
$loggerConfigPath = KALTURA_TEST_PATH . "/config/logger.ini";
try {
    $config = new Zend_Config_Ini($loggerConfigPath);
} catch (Zend_Config_Exception $ex) {
    $config = null;
}
KalturaLog::initLog($config);
KalturaLog::setContext("TESTS");
// set DB
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
开发者ID:richhl,项目名称:kalturaCE,代码行数:26,代码来源:bootstrapApi.php

示例11: 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();
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:index.php

示例12: set_time_limit

<?php

set_time_limit(0);
ini_set("memory_limit", "700M");
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';
$include_path = realpath(dirname(__FILE__) . '/../vendor/ZendFramework/library') . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/../vendor/phpseclib') . PATH_SEPARATOR . get_include_path();
set_include_path($include_path);
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "phpseclib", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"));
KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/scripts/classMap.cache');
KAutoloader::register();
date_default_timezone_set(kConf::get("date_default_timezone"));
$loggerConfigPath = KALTURA_ROOT_PATH . '/configurations/logger.ini';
try {
    $config = new Zend_Config_Ini($loggerConfigPath);
    KalturaLog::initLog($config->scripts);
    KalturaLog::setContext(basename($_SERVER['SCRIPT_NAME']));
} catch (Zend_Config_Exception $ex) {
}
KalturaLog::info("Starting script");
KalturaLog::info("Initializing database...");
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
KalturaLog::info("Database initialized successfully");
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:28,代码来源:bootstrap.php

示例13: set_time_limit

<?php

set_time_limit(0);
ini_set("memory_limit", "700M");
define('ROOT_DIR', realpath(dirname(__FILE__) . '/../'));
require_once ROOT_DIR . '/alpha/config/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::setClassMapFilePath(kConf::get("cache_root_path") . '/scripts/classMap.cache');
KAutoloader::register();
date_default_timezone_set(kConf::get("date_default_timezone"));
$loggerConfigPath = dirname(__FILE__) . '/logger.ini';
$config = new Zend_Config_Ini($loggerConfigPath);
KalturaLog::initLog($config);
KalturaLog::setContext("SCRIPT");
KalturaLog::info("Starting script");
KalturaLog::info("Initializing database...");
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
KalturaLog::info("Database initialized successfully");
开发者ID:richhl,项目名称:kalturaCE,代码行数:21,代码来源:bootstrap.php


注:本文中的KalturaLog::setContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。