本文整理汇总了PHP中common_Logger::i方法的典型用法代码示例。如果您正苦于以下问题:PHP common_Logger::i方法的具体用法?PHP common_Logger::i怎么用?PHP common_Logger::i使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common_Logger
的用法示例。
在下文中一共展示了common_Logger::i方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: launch
/**
* Entrypoint of every tool
*/
public function launch()
{
try {
taoLti_models_classes_LtiService::singleton()->startLtiSession(common_http_Request::currentRequest());
// check if cookie has been set
if (tao_models_classes_accessControl_AclProxy::hasAccess('verifyCookie', 'CookieUtils', 'taoLti')) {
$this->redirect(_url('verifyCookie', 'CookieUtils', 'taoLti', array('session' => session_id(), 'redirect' => _url('run', null, null, $_GET))));
} else {
$this->returnError(__('You are not authorized to use this system'));
}
} catch (common_user_auth_AuthFailedException $e) {
common_Logger::i($e->getMessage());
$this->returnError(__('The LTI connection could not be established'), false);
} catch (taoLti_models_classes_LtiException $e) {
// In regard of the IMS LTI standard, we have to show a back button that refer to the
// launch_presentation_return_url url param. So we have to retrieve this parameter before trying to start
// the session
$params = common_http_Request::currentRequest()->getParams();
if (isset($params[taoLti_models_classes_LtiLaunchData::TOOL_CONSUMER_INSTANCE_NAME])) {
$this->setData('consumerLabel', $params[taoLti_models_classes_LtiLaunchData::TOOL_CONSUMER_INSTANCE_NAME]);
} elseif (isset($params[taoLti_models_classes_LtiLaunchData::TOOL_CONSUMER_INSTANCE_DESCRIPTION])) {
$this->setData('consumerLabel', $params[taoLti_models_classes_LtiLaunchData::TOOL_CONSUMER_INSTANCE_DESCRIPTION]);
}
if (isset($params[taoLti_models_classes_LtiLaunchData::LAUNCH_PRESENTATION_RETURN_URL])) {
$this->setData('returnUrl', $params[taoLti_models_classes_LtiLaunchData::LAUNCH_PRESENTATION_RETURN_URL]);
}
common_Logger::i($e->getMessage());
$this->returnError(__('The LTI connection could not be established'), false);
} catch (tao_models_classes_oauth_Exception $e) {
common_Logger::i($e->getMessage());
$this->returnError(__('The LTI connection could not be established'), false);
}
}
示例2: uninstall
/**
* uninstall an extension
*
* @access public
* @author Jerome Bogaerts, <jerome@taotesting.com>
* @return boolean
*/
public function uninstall()
{
common_Logger::i('Uninstalling ' . $this->extension->getId(), 'UNINSTALL');
// uninstall possible
if (is_null($this->extension->getManifest()->getUninstallData())) {
throw new common_Exception('Problem uninstalling extension ' . $this->extension->getId() . ' : Uninstall not supported');
}
// installed?
if (!common_ext_ExtensionsManager::singleton()->isInstalled($this->extension->getId())) {
throw new common_Exception('Problem uninstalling extension ' . $this->extension->getId() . ' : Not installed');
}
// check dependcies
if (helpers_ExtensionHelper::isRequired($this->extension)) {
throw new common_Exception('Problem uninstalling extension ' . $this->extension->getId() . ' : Still required');
}
common_Logger::d('uninstall script for ' . $this->extension->getId());
$this->uninstallScripts();
// hook
$this->extendedUninstall();
common_Logger::d('unregister extension ' . $this->extension->getId());
$this->unregister();
// we purge the whole cache.
$cache = common_cache_FileCache::singleton();
$cache->purge();
common_Logger::i('Uninstalled ' . $this->extension->getId());
return true;
}
示例3: create
/**
* Creates a new delivery
*
* @param core_kernel_classes_Class $deliveryClass
* @param core_kernel_classes_Resource $test
* @param array $properties Array of properties of delivery
* @return common_report_Report
*/
public static function create(\core_kernel_classes_Class $deliveryClass, \core_kernel_classes_Resource $test, $properties = array())
{
\common_Logger::i('Creating delivery with ' . $test->getLabel() . ' under ' . $deliveryClass->getLabel());
$storage = new TrackedStorage();
$testCompilerClass = \taoTests_models_classes_TestsService::singleton()->getCompilerClass($test);
$compiler = new $testCompilerClass($test, $storage);
$report = $compiler->compile();
if ($report->getType() == \common_report_Report::TYPE_SUCCESS) {
//$tz = new \DateTimeZone(\common_session_SessionManager::getSession()->getTimeZone());
$tz = new \DateTimeZone('UTC');
if (!empty($properties[TAO_DELIVERY_START_PROP])) {
$dt = new \DateTime($properties[TAO_DELIVERY_START_PROP], $tz);
$properties[TAO_DELIVERY_START_PROP] = (string) $dt->getTimestamp();
}
if (!empty($properties[TAO_DELIVERY_END_PROP])) {
$dt = new \DateTime($properties[TAO_DELIVERY_END_PROP], $tz);
$properties[TAO_DELIVERY_END_PROP] = (string) $dt->getTimestamp();
}
$serviceCall = $report->getData();
$properties[PROPERTY_COMPILEDDELIVERY_DIRECTORY] = $storage->getSpawnedDirectoryIds();
$compilationInstance = DeliveryAssemblyService::singleton()->createAssemblyFromServiceCall($deliveryClass, $serviceCall, $properties);
$report->setData($compilationInstance);
}
return $report;
}
示例4: complies
/**
* @param array $conditions
* @param string $conditionService
* @return bool
*/
protected function complies(array $conditions, $conditionService)
{
$clientName = $conditionService::singleton()->getClientName();
$clientVersion = $conditionService::singleton()->getClientVersion();
$clientNameResource = $conditionService::singleton()->getClientNameResource();
\common_Logger::i("Detected client: {$clientName} @ {$clientVersion}");
$result = false;
/** @var \core_kernel_classes_Property $browser */
foreach ($conditions as $condition) {
if ($condition->exists() === true) {
/** @var \core_kernel_classes_Resource $requiredName */
$requiredName = $condition->getOnePropertyValue(new \core_kernel_classes_Property($conditionService::PROPERTY_NAME));
if ($clientNameResource && !$clientNameResource->equals($requiredName)) {
\common_Logger::i("Client rejected. Required name is {$requiredName} but current name is {$clientName}.");
continue;
} elseif ($clientNameResource === null) {
\common_Logger::i("Client rejected. Unknown client.");
continue;
}
$requiredVersion = $condition->getOnePropertyValue(new \core_kernel_classes_Property($conditionService::PROPERTY_VERSION));
if (-1 !== version_compare($conditionService::singleton()->getClientVersion(), $requiredVersion)) {
$result = true;
break;
}
}
}
return $result;
}
示例5: __invoke
public function __invoke($params)
{
$persistenceId = count($params) > 0 ? reset($params) : 'default';
$persistence = \common_persistence_Manager::getPersistence($persistenceId);
$schemaManager = $persistence->getDriver()->getSchemaManager();
$schema = $schemaManager->createSchema();
$fromSchema = clone $schema;
try {
$tableLog = $schema->createTable(RdsDeliveryLogService::TABLE_NAME);
$tableLog->addOption('engine', 'InnoDB');
$tableLog->addColumn(RdsDeliveryLogService::ID, "integer", array("autoincrement" => true));
$tableLog->addColumn(RdsDeliveryLogService::DELIVERY_EXECUTION_ID, "string", array("notnull" => true, "length" => 255));
$tableLog->addColumn(RdsDeliveryLogService::EVENT_ID, "string", array("notnull" => true, "length" => 255));
$tableLog->addColumn(RdsDeliveryLogService::DATA, "text", array("notnull" => true));
$tableLog->addColumn(RdsDeliveryLogService::CREATED_AT, "string", array("notnull" => true, "length" => 255));
$tableLog->addColumn(RdsDeliveryLogService::CREATED_BY, "string", array("notnull" => true, "length" => 255));
$tableLog->setPrimaryKey(array(RdsDeliveryLogService::ID));
$tableLog->addIndex(array(RdsDeliveryLogService::DELIVERY_EXECUTION_ID), 'IDX_' . RdsDeliveryLogService::TABLE_NAME . '_' . RdsDeliveryLogService::DELIVERY_EXECUTION_ID);
} catch (SchemaException $e) {
\common_Logger::i('Database Schema already up to date.');
}
$queries = $persistence->getPlatform()->getMigrateSchemaSql($fromSchema, $schema);
foreach ($queries as $query) {
$persistence->exec($query);
}
$this->registerService(RdsDeliveryLogService::SERVICE_ID, new RdsDeliveryLogService(array(RdsDeliveryLogService::OPTION_PERSISTENCE => $persistenceId)));
return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, __('Registered proctoring log'));
}
示例6: evaluate
/**
* Short description of method evaluate
*
* @access public
* @author firstname and lastname of author, <author@example.org>
* @param array $variable
* @return mixed
*/
public function evaluate($variable = array())
{
common_Logger::i('Evaluating Term uri : ' . $this->getUri(), array('Generis Term'));
common_Logger::i('Evaluating Term name : ' . $this->getLabel(), array('Generis Term'));
$termType = $this->getUniquePropertyValue(new core_kernel_classes_Property(RDF_TYPE));
common_Logger::d('Term s type : ' . $termType->getUri(), array('Generis Term'));
switch ($termType->getUri()) {
case CLASS_TERM:
throw new common_Exception("Forbidden Type of Term");
break;
case CLASS_TERM_SUJET_PREDICATE_X:
$returnValue = $this->evaluateSPX($variable);
break;
case CLASS_TERM_X_PREDICATE_OBJECT:
$returnValue = $this->evaluateXPO();
break;
case CLASS_CONSTRUCTED_SET:
$returnValue = $this->evaluateSet();
break;
case CLASS_TERM_CONST:
$returnValue = $this->evaluateConst();
break;
case CLASS_OPERATION:
$returnValue = $this->evaluateOperation($variable);
break;
default:
throw new common_Exception('problem evaluating Term');
}
return $returnValue;
}
示例7: __construct
/**
*
* @param array callOptions an array of parameters sent to the results storage configuration
* @param mixed $resultServer
* @param string uri or resource
*/
public function __construct($resultServer, $additionalStorages = array())
{
$this->implementations = array();
if (is_object($resultServer) and get_class($resultServer) == 'core_kernel_classes_Resource') {
$this->resultServer = $resultServer;
} else {
if (common_Utils::isUri($resultServer)) {
$this->resultServer = new core_kernel_classes_Resource($resultServer);
}
}
// the static storages
if ($this->resultServer->getUri() != TAO_VOID_RESULT_SERVER) {
$resultServerModels = $this->resultServer->getPropertyValues(new core_kernel_classes_Property(TAO_RESULTSERVER_MODEL_PROP));
if (!isset($resultServerModels) or count($resultServerModels) == 0) {
throw new common_Exception("The result server is not correctly configured (Resource definition)");
}
foreach ($resultServerModels as $resultServerModelUri) {
$resultServerModel = new core_kernel_classes_Resource($resultServerModelUri);
$this->addImplementation($resultServerModel->getUniquePropertyValue(new core_kernel_classes_Property(TAO_RESULTSERVER_MODEL_IMPL_PROP))->literal);
}
}
if (!is_null($additionalStorages)) {
// the dynamic storages
foreach ($additionalStorages as $additionalStorage) {
$this->addImplementation($additionalStorage["implementation"], $additionalStorage["parameters"]);
}
}
common_Logger::i("Result Server Initialized using defintion:" . $this->resultServer->getUri());
// sets the details required depending on the type of storage
}
示例8: __invoke
public function __invoke($params)
{
$persistenceId = count($params) > 0 ? reset($params) : 'default';
$persistence = $this->getServiceLocator()->get(\common_persistence_Manager::SERVICE_KEY)->getPersistenceById($persistenceId);
$schemaManager = $persistence->getDriver()->getSchemaManager();
$schema = $schemaManager->createSchema();
$fromSchema = clone $schema;
try {
$revisionTable = $schema->createtable(Storage::REVISION_TABLE_NAME);
$revisionTable->addOption('engine', 'MyISAM');
$revisionTable->addColumn(Storage::REVISION_RESOURCE, "string", array("notnull" => false, "length" => 255));
$revisionTable->addColumn(Storage::REVISION_VERSION, "string", array("notnull" => false, "length" => 50));
$revisionTable->addColumn(Storage::REVISION_USER, "string", array("notnull" => true, "length" => 255));
$revisionTable->addColumn(Storage::REVISION_CREATED, "string", array("notnull" => true));
$revisionTable->addColumn(Storage::REVISION_MESSAGE, "string", array("notnull" => true, "length" => 4000));
$revisionTable->setPrimaryKey(array(Storage::REVISION_RESOURCE, Storage::REVISION_VERSION));
$dataTable = $schema->createtable(Storage::DATA_TABLE_NAME);
$dataTable->addOption('engine', 'MyISAM');
$dataTable->addColumn(Storage::DATA_RESOURCE, "string", array("notnull" => false, "length" => 255));
$dataTable->addColumn(Storage::DATA_VERSION, "string", array("notnull" => false, "length" => 50));
$dataTable->addColumn(Storage::DATA_SUBJECT, "string", array("notnull" => true, "length" => 255));
$dataTable->addColumn(Storage::DATA_PREDICATE, "string", array("length" => 255));
// not compatible with oracle
$dataTable->addColumn(Storage::DATA_OBJECT, "text", array("default" => null, "notnull" => false));
$dataTable->addColumn(Storage::DATA_LANGUAGE, "string", array("length" => 50));
$dataTable->addForeignKeyConstraint($revisionTable, array(Storage::REVISION_RESOURCE, Storage::REVISION_VERSION), array(Storage::REVISION_RESOURCE, Storage::REVISION_VERSION));
} catch (SchemaException $e) {
\common_Logger::i('Database Schema already up to date.');
}
$queries = $persistence->getPlatform()->getMigrateSchemaSql($fromSchema, $schema);
foreach ($queries as $query) {
$persistence->exec($query);
}
}
示例9: update
/**
* Update all the item files found within the $itemRootPath
* @param boolean $changeItemContent - tells if the item files will be written with the updated content or not
* @return array of modified item instances
*/
public function update($changeItemContent = false)
{
$returnValue = array();
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->itemPath), RecursiveIteratorIterator::SELF_FIRST);
$i = 0;
$fixed = 0;
foreach ($objects as $itemFile => $cursor) {
if (is_file($itemFile)) {
$this->checkedFiles[$itemFile] = false;
if (basename($itemFile) === 'qti.xml') {
$i++;
$xml = new \DOMDocument();
$xml->load($itemFile);
$parser = new ParserFactory($xml);
$item = $parser->load();
\common_Logger::i('checking item #' . $i . ' id:' . $item->attr('identifier') . ' file:' . $itemFile);
if ($this->updateItem($item, $itemFile)) {
$this->checkedFiles[$itemFile] = true;
$returnValue[$itemFile] = $item;
\common_Logger::i('fixed required for #' . $i . ' id:' . $item->attr('identifier') . ' file:' . $itemFile);
if ($changeItemContent) {
$fixed++;
\common_Logger::i('item fixed #' . $i . ' id:' . $item->attr('identifier') . ' file:' . $itemFile);
file_put_contents($itemFile, $item->toXML());
}
}
}
}
}
\common_Logger::i('total item fixed : ' . $fixed);
return $returnValue;
}
示例10: install
/**
* install an extension
*
* @access public
* @author Jerome Bogaerts, <jerome@taotesting.com>
* @return void
*/
public function install()
{
common_Logger::i('Installing extension ' . $this->extension->getId(), 'INSTALL');
if ($this->extension->getId() == 'generis') {
throw new common_ext_ForbiddenActionException('Tried to install generis using the ExtensionInstaller', $this->extension->getId());
}
if (common_ext_ExtensionsManager::singleton()->isInstalled($this->extension->getId())) {
throw new common_ext_AlreadyInstalledException('Problem installing extension ' . $this->extension->getId() . ' : Already installed', $this->extension->getId());
}
// we purge the whole cache.
$cache = common_cache_FileCache::singleton();
$cache->purge();
// check reuired extensions, throws exception if failed
helpers_ExtensionHelper::checkRequiredExtensions($this->getExtension());
$this->installLoadDefaultConfig();
$this->installOntology();
$this->installRegisterExt();
common_Logger::d('Installing custom script for extension ' . $this->extension->getId());
$this->installCustomScript();
common_Logger::d('Done installing custom script for extension ' . $this->extension->getId());
if ($this->getLocalData() == true) {
common_Logger::d('Installing local data for extension ' . $this->extension->getId());
$this->installLocalData();
common_Logger::d('Done installing local data for extension ' . $this->extension->getId());
}
common_Logger::d('Extended install for extension ' . $this->extension->getId());
// Method to be overriden by subclasses
// to extend the installation mechanism.
$this->extendedInstall();
common_Logger::d('Done extended install for extension ' . $this->extension->getId());
$eventManager = ServiceManager::getServiceManager()->get(EventManager::CONFIG_ID);
$eventManager->trigger(new common_ext_event_ExtensionInstalled($this->extension));
}
示例11: authenticate
/**
* Short description of method authenticate
*
* @access public
* @author Joel Bout, <joel.bout@tudor.lu>
* @param Repository vcs
* @param string login
* @param string password
* @return boolean
*/
public function authenticate(core_kernel_versioning_Repository $vcs, $login, $password)
{
$returnValue = (bool) false;
common_Logger::i(__FUNCTION__ . ' called on local directory', 'LOCALVCS');
$returnValue = is_dir($vcs->getPath());
return (bool) $returnValue;
}
示例12: setUp
public function setUp()
{
TaoPhpUnitTestRunner::initTest();
$this->disableCache();
// creates a user using remote script from joel
$testUserData = array(PROPERTY_USER_LOGIN => 'tjdoe', PROPERTY_USER_PASSWORD => 'test123', PROPERTY_USER_LASTNAME => 'Doe', PROPERTY_USER_FIRSTNAME => 'John', PROPERTY_USER_MAIL => 'jdoe@tao.lu', PROPERTY_USER_DEFLG => \tao_models_classes_LanguageService::singleton()->getLanguageByCode(DEFAULT_LANG)->getUri(), PROPERTY_USER_UILG => \tao_models_classes_LanguageService::singleton()->getLanguageByCode(DEFAULT_LANG)->getUri(), PROPERTY_USER_ROLES => array(INSTANCE_ROLE_GLOBALMANAGER));
$testUserData[PROPERTY_USER_PASSWORD] = 'test' . rand();
$data = $testUserData;
$data[PROPERTY_USER_PASSWORD] = \core_kernel_users_Service::getPasswordHash()->encrypt($data[PROPERTY_USER_PASSWORD]);
$tmclass = new \core_kernel_classes_Class(CLASS_TAO_USER);
$user = $tmclass->createInstanceWithProperties($data);
\common_Logger::i('Created user ' . $user->getUri());
// prepare a lookup table of languages and values
$usage = new \core_kernel_classes_Resource(INSTANCE_LANGUAGE_USAGE_GUI);
$propValue = new \core_kernel_classes_Property(RDF_VALUE);
$langService = \tao_models_classes_LanguageService::singleton();
$lookup = array();
foreach ($langService->getAvailableLanguagesByUsage($usage) as $lang) {
$lookup[$lang->getUri()] = (string) $lang->getUniquePropertyValue($propValue);
}
$data = array('rootUrl' => ROOT_URL, 'userUri' => $user->getUri(), 'userData' => $testUserData, 'lang' => $lookup);
$this->login = $data['userData'][PROPERTY_USER_LOGIN];
$this->password = $data['userData'][PROPERTY_USER_PASSWORD];
$this->userUri = $data['userUri'];
}
示例13: __invoke
public function __invoke($params)
{
if (!isset($params[0])) {
return new \common_report_Report(\common_report_Report::TYPE_ERROR, __('Usage: InitRdsQueue PERSISTENCE_ID'));
}
$persistenceId = $params[0];
$serviceManager = ServiceManager::getServiceManager();
$persistence = \common_persistence_Manager::getPersistence($persistenceId);
$schemaManager = $persistence->getDriver()->getSchemaManager();
$schema = $schemaManager->createSchema();
$fromSchema = clone $schema;
try {
$queueTable = $schema->createtable(RdsQueue::QUEUE_TABLE_NAME);
$queueTable->addOption('engine', 'MyISAM');
$queueTable->addColumn(RdsQueue::QUEUE_ID, "integer", array("notnull" => true, "autoincrement" => true));
$queueTable->addColumn(RdsQueue::QUEUE_STATUS, "string", array("notnull" => true, "length" => 50));
$queueTable->addColumn(RdsQueue::QUEUE_ADDED, "string", array("notnull" => true));
$queueTable->addColumn(RdsQueue::QUEUE_UPDATED, "string", array("notnull" => true));
$queueTable->addColumn(RdsQueue::QUEUE_OWNER, "string", array("notnull" => false, "length" => 255));
$queueTable->addColumn(RdsQueue::QUEUE_TASK, "string", array("notnull" => true, "length" => 4000));
$queueTable->setPrimaryKey(array(RdsQueue::QUEUE_ID));
$queries = $persistence->getPlatform()->getMigrateSchemaSql($fromSchema, $schema);
foreach ($queries as $query) {
$persistence->exec($query);
}
} catch (SchemaException $e) {
\common_Logger::i('Database Schema already up to date.');
}
$queue = new RdsQueue(array(RdsQueue::OPTION_PERSISTENCE => $persistenceId));
$serviceManager->register(Queue::CONFIG_ID, $queue);
return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, __('Setup rds queue successfully'));
}
示例14: exportModels
/**
* Export models by id
*
* @param array $modelIds
* @return string
*/
public static function exportModels($modelIds)
{
$dbWrapper = core_kernel_classes_DbWrapper::singleton();
$result = $dbWrapper->query('SELECT DISTINCT "subject", "predicate", "object", "l_language" FROM "statements"
WHERE "modelid" IN (\'' . implode('\',\'', $modelIds) . '\')');
common_Logger::i('Found ' . $result->rowCount() . ' entries for models ' . implode(',', $modelIds));
return self::statement2rdf($result);
}
示例15: cloneFile
protected static function cloneFile($fileUri)
{
\common_Logger::i('clone file ' . $fileUri);
$file = new \core_kernel_versioning_File($fileUri);
$newFile = $file->getRepository()->spawnFile($file->getAbsolutePath(), $file->getLabel(), function ($originalName) {
return md5($originalName);
});
return $newFile->getUri();
}