本文整理汇总了PHP中LogHelper类的典型用法代码示例。如果您正苦于以下问题:PHP LogHelper类的具体用法?PHP LogHelper怎么用?PHP LogHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LogHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: log
public static function log($message, $severity = self::SEVERITY_INFO)
{
$date = date('Y-m-d H:i:s') . " - ";
$severity = $severity . " - ";
$payload = $date . $severity . $message;
$logger = new LogHelper();
$logger->_write($payload);
}
开发者ID:roycocup,项目名称:stargym,代码行数:8,代码来源:LogHelper.php
示例2: load
public function load(AbstractMetaModel $environment_metamodel, array $filters = NULL) {
LogHelper::log_notice(t('Generating Environment Meta Model for Drupal database connections ...'));
global $databases;
$datasourceCount = 0;
foreach ($databases as $namespace => $connections) {
foreach ($connections as $datasourceNameOnly => $connection) {
$datasource = new DataSourceMetaData();
$datasource->name = NameSpaceHelper::addNameSpace($namespace, $datasourceNameOnly);
$datasource->markAsPrivate();
$datasource->readonly = FALSE;
// setting required properties
$this->setDataSourceProperty($datasource, $connection, 'type', 'driver');
// setting other provided properties
$this->setDataSourceExtensionProperties($datasource, $connection);
// registering the data source
$environment_metamodel->registerDataSource($datasource);
$datasourceCount++;
}
}
// Default database connection is shared because we store common utilities and dimensions there
$defaultDataSource = $environment_metamodel->getDataSource(self::$DATASOURCE_NAME__DEFAULT);
$defaultDataSource->shared = TRUE;
LogHelper::log_info(t('Generated @datasourceCount data sources', array('@datasourceCount' => $datasourceCount)));
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:29,代码来源:DrupalDatabaseEnvironmentMetaModelGenerator.php
示例3: apply
public function apply ( $patients ) {
if ( !is_array($patients) ) {
$patients = array($patients);
}
foreach ( $patients as $patient ) {
\LogHelper::log_info('Applying ReportConfigRemoveColumnConfig treatment to: ' . $patient->reportNodeId);
$node = node_load($patient->reportNodeId);
$reportConfigText = get_node_field_value($node, 'field_report_conf', 0, 'value', FALSE);
$reportConfig = isset($reportConfigText) ? json_decode($reportConfigText) : NULL;
if (!isset($reportConfig)) {
\LogHelper::log_info('Report configuration is EMPTY');
return;
}
// check column configs
if (!empty($reportConfig->columnConfigs)) {
foreach ($reportConfig->columnConfigs as $key => $value) {
if (empty($value->columnId)) {
unset($reportConfig->columnConfigs[$key]);
}
}
$node->field_report_conf[$node->language][0]['value'] = json_encode($reportConfig);
node_save($node);
}
}
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:31,代码来源:RemoveColumnConfigTreatment.php
示例4: actionDescription
public function actionDescription()
{
Yii::app()->page->setInfo(array("description" => $this->description, "keyWord" => $this->keyWord));
$id = 0;
$class = $this->classModel;
if (!empty($_GET["slug"])) {
$model = $class::fetchBySlug(trim($_GET["slug"]));
if ($model->id > 0) {
$_GET["id"] = $model->id;
$id = $model->id;
}
}
if ($id > 0) {
LogHelper::save("resorts", $id, "show");
$item = CatalogKurorts::fetch($id);
if ($item->id > 0) {
Yii::app()->page->title = $item->name;
$this->render('description', array("item" => $item, "otherHotels" => CatalogKurorts::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("image>'' AND category_id=:category_id AND id!=:id")->setParams(array(":category_id" => $item->category_id->id, ":id" => $item->id))->setOrderBy("col DESC")->setLimit(8)), "hotelCount" => CatalogKurorts::count(DBQueryParamsClass::CreateParams()->setConditions("category_id=:category")->setParams(array(":category" => $item->category_id->id)))));
} else {
throw new CHttpException("Ошибка", Yii::t("page", "Ошибка перехода на страницу"));
}
} else {
throw new CHttpException("Ошибка", Yii::t("page", "Ошибка перехода на страницу"));
}
}
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:25,代码来源:ResortsController.php
示例5: actionDescription
public function actionDescription()
{
Yii::app()->page->setInfo(array("description" => $this->description, "keyWord" => $this->keyWord));
$id = 0;
$class = $this->classModel;
if (!empty($_GET["slug"])) {
$model = $class::fetchBySlug(trim($_GET["slug"]));
if ($model->id > 0) {
$_GET["id"] = $model->id;
$id = $model->id;
} else {
$arrId = explode("-", $_GET["slug"]);
if (sizeof($arrId) > 0) {
$id = (int) $arrId[0];
}
}
}
$error = Yii::t("page", "Произошла ошибка перехода на страницу, проверьте правильно написания адреса страницы");
if ($id > 0) {
$item = CatalogTours::fetch($id);
if ($item->id > 0) {
LogHelper::saveCatLogTours($item->id);
CCModelHelper::colCounter($item);
// Картинки тура
$images = ImageHelper::getImages($item);
Yii::app()->page->title = $item->name . ", тур " . $item->category_id->name . ", " . $item->country_id->name;
$this->render('description', array("item" => $item, "images" => $images, "otherTours" => CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("image>'' AND country_id=:country_id AND id!=:id AND firm_id!=:firm_id")->setParams(array(":country_id" => $item->country_id->id, ":id" => $item->id, ":firm_id" => $item->firm_id->id))->setOrderBy("col DESC")->setLimit(6)), "firmsTours" => CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("image>'' AND firm_id=:firm_id AND id!=:id")->setParams(array(":firm_id" => $item->firm_id->id, ":id" => $item->id))->setOrderBy("col DESC")->setLimit(6)), "tourCount" => CatalogTours::count(DBQueryParamsClass::CreateParams()->setConditions("country_id=:country")->setParams(array(":country" => $item->country_id->id))), "firmCount" => CatalogFirms::count(DBQueryParamsClass::CreateParams()->setConditions("country_id=:country")->setParams(array(":country" => $item->country_id->id)))));
} else {
throw new CHttpException("", $error);
}
} else {
throw new CHttpException("", $error);
}
}
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:34,代码来源:ToursController.php
示例6: load
public function load(AbstractMetaModel $environment_metamodel, array $filters = NULL) {
LogHelper::log_notice(t('Loading Environment Meta Model from GovDashboard Content Types ...'));
// Note we do not apply filters because we do not have any
// if we want to use the filters we would need to prepare list of data source names
// but to prepare those name we need to load meta model.
// but that is what we are trying to do in this code
// Catch 22
if (isset($filters)) {
throw new UnsupportedOperationException(t('Filters are not supported during data source loading'));
}
$datamartNodes = gd_datamart_get_datamarts(LOAD_ENTITY);
// preparing data sources
foreach ($datamartNodes as $datamartNode) {
GD_DataMartMetaModelLoaderHelper::prepareDataSource($environment_metamodel, $datamartNode);
}
// finalizing the preparation
foreach($datamartNodes as $datamartNode) {
$datasource = GD_DataMartMetaModelLoaderHelper::getDataSourceByNodeId($environment_metamodel->datasources, $datamartNode->nid);
GD_DataMartMetaModelLoaderHelper::finalizeDataSourcePreparation($environment_metamodel, $datasource);
}
LogHelper::log_info(t('Processed @datamartCount data mart node(s)', array('@datamartCount' => count($datamartNodes))));
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:28,代码来源:GD_DataMartMetaModelLoader.php
示例7: __call
public function __call($methodName, $args)
{
$timeStart = microtime(TRUE);
$result = call_user_func_array(array($this->instance, $methodName), $args);
LogHelper::log_info(t('Data Controller execution time for @methodName(): !executionTime', array('@methodName' => $methodName, '!executionTime' => ExecutionPerformanceHelper::formatExecutionTime($timeStart))));
return $result;
}
开发者ID:ecs-hk,项目名称:Checkbook,代码行数:7,代码来源:AbstractDataControllerProxy.php
示例8: apply
public function apply ( $patients ) {
if ( !is_array($patients) ) {
$patients = array($patients);
}
foreach ( $patients as $patient ) {
\LogHelper::log_info('Applying ReportConfigRemoveFilter treatment to: ' . $patient->reportNodeId);
$node = node_load($patient->reportNodeId);
$reportConfigText = get_node_field_value($node, 'field_report_conf', 0, 'value', FALSE);
$reportConfig = isset($reportConfigText) ? json_decode($reportConfigText) : NULL;
if (!isset($reportConfig)) {
\LogHelper::log_info('Report configuration is EMPTY');
return;
}
// check column configs
if (!empty($reportConfig->model->filters)) {
$preservedFilters = array();
foreach ($reportConfig->model->filters as $key => $filter) {
if ( $patient->filter != $filter ) {
$preservedFilters[] = $filter;
}
}
$reportConfig->model->filters = $preservedFilters;
$node->field_report_conf[$node->language][0]['value'] = json_encode($reportConfig);
node_save($node);
}
}
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:33,代码来源:RemoveFilterTreatment.php
示例9: actionLog
public function actionLog()
{
$type = Yii::app()->request->getParam("type", 0);
$id = (int) Yii::app()->request->getParam("id", 0);
$action = Yii::app()->request->getParam("action", 0);
LogHelper::save($type, $id, $action);
}
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:7,代码来源:SiteController.php
示例10: apply
public function apply ( $patients ) {
if ( !is_array($patients) ) {
$patients = array($patients);
}
foreach ( $patients as $patient ) {
\LogHelper::log_info('Applying ReportRepairDataset treatment to: ' . $patient->reportNodeId);
$reportNode = node_load($patient->reportNodeId);
$reportConfigText = get_node_field_value($reportNode, 'field_report_conf', 0, 'value', FALSE);
$reportConfig = isset($reportConfigText) ? json_decode($reportConfigText) : NULL;
if (!isset($reportConfig)) {
\LogHelper::log_info('Report configuration is EMPTY');
continue;
}
// check columns
if (!empty($reportConfig->model->datasets)) {
$reportNode->field_report_dataset_sysnames[$reportNode->language] = array();
foreach ($reportConfig->model->datasets as $datasetName) {
$reportNode->field_report_dataset_sysnames[$reportNode->language][] = array('value' => $datasetName);
}
node_save($reportNode);
}
}
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:28,代码来源:RepairDatasetConfigTreatment.php
示例11: load
public function load(AbstractMetaModel $environment_metamodel, array $filters = NULL) {
LogHelper::log_notice(t('Loading Environment Meta Model from settings.php ...'));
$datasourceCount = 0;
$configurationDataSources = Environment::getInstance()->getConfigurationSection('Data Sources');
if (isset($configurationDataSources)) {
foreach ($configurationDataSources as $namespace => $sourceDataSources) {
foreach ($sourceDataSources as $datasourceName => $sourceDataSource) {
$datasourceName = NameSpaceHelper::resolveNameSpace($namespace, $datasourceName);
$datasource = new DataSourceMetaData();
$datasource->name = $datasourceName;
$datasource->initializeFrom($sourceDataSource);
// it is possible that configuration contains 'readonly' property. We need to honor it
// ... and only when it is not set we mark the data source as read only
if (!isset($datasource->readonly)) {
$datasource->readonly = TRUE;
}
$environment_metamodel->registerDataSource($datasource);
$datasourceCount++;
}
}
}
LogHelper::log_info(t('Processed @datasourceCount data sources', array('@datasourceCount' => $datasourceCount)));
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:29,代码来源:SettingsPHP_EnvironmentMetaModelLoader.php
示例12: join
public final function join(JoinController_SourceConfiguration $sourceConfigurationA, JoinController_SourceConfiguration $sourceConfigurationB)
{
$timeStart = microtime(TRUE);
$result = $this->joinSourceConfigurations($sourceConfigurationA, $sourceConfigurationB);
LogHelper::log_info(t('@className execution time: !executionTime', array('@className' => get_class($this), '!executionTime' => ExecutionPerformanceHelper::formatExecutionTime($timeStart))));
return $result;
}
开发者ID:ecs-hk,项目名称:Checkbook,代码行数:7,代码来源:AbstractJoinController.php
示例13: loadFromDirectory
protected function loadFromDirectory(AbstractMetaModel $metamodel, array $filters = NULL, $path, $namespace, $level = 0)
{
$filecount = 0;
$handle = opendir($path);
if ($handle !== FALSE) {
$indent = str_pad('', $level * 4);
while (($filename = readdir($handle)) !== FALSE) {
if (is_dir($path . DIRECTORY_SEPARATOR . $filename)) {
if ($filename[0] != '.') {
$folder = DIRECTORY_SEPARATOR . $filename;
// once name space is defined we do not change it
// it will be the same for all sub-folders regardless on depth
$ns = isset($namespace) ? $namespace : $filename;
LogHelper::log_debug(t("{$indent}Scanning '@folderName' ...", array('@folderName' => $folder)));
$filecount += $this->loadFromDirectory($metamodel, $filters, $path . $folder, $ns, $level + 1);
}
} elseif ($this->fileNameEndsWithJson($filename)) {
LogHelper::log_debug(t("{$indent}Processing '@filename' ...", array('@filename' => $filename)));
$this->loadFromFile($metamodel, $filters, $namespace, $path . DIRECTORY_SEPARATOR, $filename);
$filecount++;
}
}
closedir($handle);
}
return $filecount;
}
开发者ID:ecs-hk,项目名称:Checkbook,代码行数:26,代码来源:AbstractFileMetaModelLoader.php
示例14: loadFromDirectory
protected function loadFromDirectory(AbstractMetaModel $metamodel, array $filters = NULL, $path, $namespace, $level = 0) {
$filecount = 0;
$handle = opendir($path);
if ($handle !== FALSE) {
$indent = str_pad('', $level * 4);
while (($filename = readdir($handle)) !== FALSE) {
if (is_dir($path . DIRECTORY_SEPARATOR . $filename)) {
if ($filename[0] != '.') {
$folder = DIRECTORY_SEPARATOR . $filename;
$nestedNameSpace = isset($namespace) ? NameSpaceHelper::addNameSpace($namespace, $filename) : $filename;
LogHelper::log_debug(t("{$indent}Scanning '@folderName' ...", array('@folderName' => $folder)));
$filecount += $this->loadFromDirectory($metamodel, $filters, $path . $folder, $nestedNameSpace, $level + 1);
}
}
elseif ($this->fileNameEndsWithJson($filename)) {
LogHelper::log_debug(t("{$indent}Processing '@filename' ...", array('@filename' => $filename)));
$this->loadFromFile($metamodel, $filters, $namespace, $path . DIRECTORY_SEPARATOR, $filename);
$filecount++;
}
}
closedir($handle);
}
return $filecount;
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:30,代码来源:AbstractFileMetaModelLoader.php
示例15: prepareColumnsMetaDataProperties
protected function prepareColumnsMetaDataProperties(DataSourceMetaData $datasource, array $tableNames)
{
$datasourceHandler = DataSourceQueryFactory::getInstance()->getHandler($datasource->type);
$sql = 'SELECT c.relname AS ' . self::PROPERTY__TABLE_NAME . ', ' . ' a.attname AS ' . self::PROPERTY__COLUMN_NAME . ', ' . ' a.attnum AS ' . self::PROPERTY__COLUMN_INDEX . ', ' . ' t.typname AS ' . self::PROPERTY__COLUMN_TYPE . ' FROM pg_class c INNER JOIN pg_namespace ns ON ns.oid = c.relnamespace' . ' INNER JOIN pg_attribute a ON a.attrelid = c.oid' . ' INNER JOIN pg_type t ON t.oid = a.atttypid' . " WHERE c.relname IN ('" . implode("', '", $tableNames) . "')" . " AND c.relkind IN ('r','v')" . " AND ns.nspname = '{$datasource->schema}'" . ' AND a.attnum > 0';
LogHelper::log_info(new StatementLogMessage('metadata.dataset.systemTable', $sql));
return $datasourceHandler->executeQuery(new DataControllerCallContext(), $datasource, $sql, new PassthroughResultFormatter());
}
开发者ID:ecs-hk,项目名称:Checkbook,代码行数:7,代码来源:PostgreSQLMetaModelLoader.php
示例16: registerServer
protected function registerServer($host, $port)
{
$result = $this->memcache->addServer($host, $port);
if (!$result) {
LogHelper::log_error(t('[@cacheType] Could not add server (@host:@port)', array('@cacheType' => self::$CACHE__TYPE, '@host' => $host, '@port' => $port)));
}
return $result;
}
开发者ID:ecs-hk,项目名称:Checkbook,代码行数:8,代码来源:MemcacheHandler.php
示例17: processUnsubscription
/**
* Handle all plans for subscription.
* Main goal - to stop all automailings for unsubscribed user.
*/
public function processUnsubscription($options)
{
// Check required parameters
if (empty($options['subscriberId'])) {
LogHelper::addError('COM_NEWSLETTER_AUTOMAILING_UNSUBSCRIPTION_SUBSCRIBER_ID_ABSENT', LogHelper::CAT_AUTOMAILING);
return false;
}
}
开发者ID:Rikisha,项目名称:proj,代码行数:12,代码来源:manager.php
示例18: executeDatasetUpdateOperations
public function executeDatasetUpdateOperations(DataControllerCallContext $callcontext, DatasetMetaData $dataset, array $operations) {
$request = new UpdateDatasetStorageRequest($dataset->name);
$request->addOperations($operations);
LogHelper::log_debug($request);
$this->datasourceStructureHandler->updateDatasetStorage($callcontext, $request);
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:8,代码来源:AbstractCreateDatasetStorageImpl.php
示例19: executeManipulationStatementBatch
protected function executeManipulationStatementBatch(DataSourceMetaData $datasource, $sqls) {
$sql = (count($sqls) == 1)
? $sqls
: $this->getExtension('prepareManipulationStatementBatch')->prepare($this, $sqls);
LogHelper::log_info(new StatementLogMessage('table.DML', $sql));
return $this->executeStatement($datasource, $sql);
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:8,代码来源:AbstractSQLDataSourceManipulationHandler.php
示例20: dropDimensionStorage
public function dropDimensionStorage(DataControllerCallContext $callcontext, DataSourceStructureHandler $datasourceStructureHandler, DatasetMetaData $logicalDataset, $columnName) {
$lookupDatasetName = StarSchemaNamingConvention::getAttributeRelatedName($logicalDataset->name, $columnName);
$request = new DatasetStorageRequest($lookupDatasetName);
LogHelper::log_debug($request);
$datasourceStructureHandler->dropDatasetStorage($callcontext, $request);
parent::dropDimensionStorage($callcontext, $datasourceStructureHandler, $logicalDataset, $columnName);
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:9,代码来源:StarSchemaStringDimensionHandler.php
注:本文中的LogHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论