本文整理汇总了PHP中LogHelper::log_notice方法的典型用法代码示例。如果您正苦于以下问题:PHP LogHelper::log_notice方法的具体用法?PHP LogHelper::log_notice怎么用?PHP LogHelper::log_notice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogHelper
的用法示例。
在下文中一共展示了LogHelper::log_notice方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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))));
}
示例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: 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
示例4: __call
public function __call($methodName, $args) {
$timeStart = microtime(TRUE);
$result = call_user_func_array(array($this->controllerInstance, $methodName), $args);
LogHelper::log_notice(t(
'Data Controller execution time for @methodName(): !executionTime',
array('@methodName' => $methodName, '!executionTime' => LogHelper::formatExecutionTime($timeStart))));
return $result;
}
示例5: join
final public function join(JoinController_SourceConfiguration $sourceConfigurationA, JoinController_SourceConfiguration $sourceConfigurationB) {
$timeStart = microtime(TRUE);
$result = $this->joinSourceConfigurations($sourceConfigurationA, $sourceConfigurationB);
LogHelper::log_notice(t(
'@className execution time: !executionTime',
array('@className' => get_class($this), '!executionTime' => LogHelper::formatExecutionTime($timeStart))));
return $result;
}
示例6: openResource
public function openResource() {
LogHelper::log_notice(t('Parsing data from a buffer (size: @bufferSize) ...', array('@bufferSize' => $this->bufferSize)));
$result = parent::openResource();
if ($result) {
$this->index = 0;
}
return $result;
}
示例7: load
public function load(AbstractMetaModelFactory $factory, AbstractMetaModel $environment_metamodel, array $filters = NULL, $finalAttempt)
{
LogHelper::log_notice(t('Generating Environment Meta Model for APC cache ...'));
$datasourceCount = 0;
$datasource = new DataSourceMetaData();
$datasource->name = NameSpaceHelper::addNameSpace(APCHandler::$CACHE__TYPE, DefaultCacheFactory::$DATASOURCE_NAME__DEFAULT);
$datasource->type = APCHandler::$CACHE__TYPE;
$environment_metamodel->registerDataSource($datasource);
$datasourceCount++;
LogHelper::log_info(t('Generated @datasourceCount data sources', array('@datasourceCount' => $datasourceCount)));
return self::LOAD_STATE__SUCCESSFUL;
}
示例8: openResource
public function openResource() {
LogHelper::log_notice(t('Parsing @filename ...', array('@filename' => $this->filename)));
$result = parent::openResource();
if ($result) {
ini_set('auto_detect_line_endings', TRUE);
$this->handle = fopen($this->filename, 'r');
$result = $this->handle !== FALSE;
}
return $result;
}
示例9: load
public function load(AbstractMetaModelFactory $factory, AbstractMetaModel $environment_metamodel, array $filters = NULL) {
LogHelper::log_notice(t('Generating Environment Meta Model for PHP dataset functionality ...'));
$datasourceCount = 0;
$datasource = new DataSourceMetaData();
$datasource->name = PHPDataSourceHandler::$DATASOURCE_NAME__DEFAULT;
$datasource->type = PHPDataSourceHandler::$DATASOURCE__TYPE;
$environment_metamodel->registerDataSource($datasource);
$datasourceCount++;
LogHelper::log_info(t('Generated @datasourceCount data sources', array('@datasourceCount' => $datasourceCount)));
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:13,代码来源:PHPDatasetEnvironmentMetaModelGenerator.php
示例10: __construct
public function __construct($prefix, DataSourceMetaData $datasource)
{
LogHelper::log_notice(t('[@cacheType] Initializing PHP extension ...', array('@cacheType' => $this->getCacheType())));
// taking into account possible datasource's nested name space
$adjustedPrefix = isset($datasource->nestedNameSpace) ? NameSpaceHelper::addNameSpace($prefix, $datasource->nestedNameSpace) : $prefix;
parent::__construct($adjustedPrefix);
// the optional datasource can have its own expiration schedule
if (isset($datasource->entryExpiration)) {
$this->entryExpiration = $datasource->entryExpiration;
}
if ($this->initialize($prefix, $datasource) !== FALSE) {
$this->checkAccessibility(FALSE);
}
}
示例11: load
public function load(AbstractMetaModel $environment_metamodel, array $filters = NULL) {
LogHelper::log_notice(t('Generating Environment Meta Model for APC cache ...'));
$datasourceCount = 0;
$datasource = new DataSourceMetaData();
$datasource->name = NameSpaceHelper::addNameSpace(APCHandler::CACHE__TYPE, 'default');
$datasource->type = APCHandler::CACHE__TYPE;
$datasource->category = CacheFactory::$DATASOURCE__CATEGORY;
$datasource->markAsPrivate();
$environment_metamodel->registerDataSource($datasource);
$datasourceCount++;
LogHelper::log_info(t('Generated @datasourceCount data sources', array('@datasourceCount' => $datasourceCount)));
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:16,代码来源:APCEnvironmentMetaModelGenerator.php
示例12: load
public function load(AbstractMetaModelFactory $factory, AbstractMetaModel $environment_metamodel, array $filters = NULL, $finalAttempt)
{
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->system = TRUE;
$datasource->readonly = TRUE;
$datasource->initializeFrom($sourceDataSource);
$environment_metamodel->registerDataSource($datasource);
$datasourceCount++;
}
}
}
LogHelper::log_info(t('Processed @datasourceCount data sources', array('@datasourceCount' => $datasourceCount)));
return self::LOAD_STATE__SUCCESSFUL;
}
示例13: load
public function load(AbstractMetaModelFactory $factory, AbstractMetaModel $metamodel, array $filters = NULL, $finalAttempt)
{
$selectedDataSourceType = $this->selectedDataSourceType();
LogHelper::log_notice(t("Finalizing Dataset Meta Data for '@databaseType' database connections ...", array('@databaseType' => $selectedDataSourceType)));
if ($finalAttempt === FALSE) {
return self::LOAD_STATE__POSTPONED;
}
$finalizedDatasetCount = 0;
$environment_metamodel = data_controller_get_environment_metamodel();
// processing all database connections
foreach ($environment_metamodel->datasources as $datasource) {
if ($datasource->type !== $selectedDataSourceType) {
continue;
}
// selecting datasets which could be processed for the selected connection
$selectedSources = NULL;
foreach ($metamodel->datasets as $dataset) {
// the dataset should belong to the selected data source
if ($dataset->datasourceName !== $datasource->name) {
continue;
}
// the dataset has to be of type table
if (DatasetTypeHelper::detectDatasetSourceType($dataset) !== DatasetTypeHelper::DATASET_SOURCE_TYPE__TABLE) {
continue;
}
// whole dataset meta data was prepared using different method. There is nothing else can be done
if ($dataset->isComplete()) {
continue;
}
$tableName = strtolower($dataset->source);
// invalidating existing column indexes
$dataset->invalidateColumnIndexes();
// there could be several datasets for one table
$selectedSources[$tableName][] = $dataset;
}
if (!isset($selectedSources)) {
continue;
}
$datasourceHandler = DataSourceQueryFactory::getInstance()->getHandler($datasource->type);
$metadataCallback = $datasourceHandler->prepareQueryStatementExecutionCallbackInstance();
// processing meta data for selected datasets
$columnsMetaDataProperties = $this->prepareColumnsMetaDataProperties($datasource, array_keys($selectedSources));
if (isset($columnsMetaDataProperties)) {
foreach ($columnsMetaDataProperties as $columnMetaDataProperties) {
$tableName = strtolower($columnMetaDataProperties[self::PROPERTY__TABLE_NAME]);
$datasets = $selectedSources[$tableName];
foreach ($datasets as $dataset) {
$column = new ColumnMetaData();
$column->name = strtolower($columnMetaDataProperties[self::PROPERTY__COLUMN_NAME]);
$column->columnIndex = $columnMetaDataProperties[self::PROPERTY__COLUMN_INDEX];
// preparing column type
$column->type->databaseType = $columnMetaDataProperties[self::PROPERTY__COLUMN_TYPE];
$column->type->applicationType = $metadataCallback->calculateApplicationDataType($column);
// checking if the column is a system column which should be invisible
if (substr_compare($column->name, DatasetSystemColumnNames::COLUMN_NAME_PREFIX, 0, strlen(DatasetSystemColumnNames::COLUMN_NAME_PREFIX)) === 0) {
$column->visible = FALSE;
}
$dataset->initializeColumnFrom($column);
}
}
}
// marking all selected datasets as completed
foreach ($selectedSources as $datasets) {
foreach ($datasets as $dataset) {
$dataset->markAsComplete();
$finalizedDatasetCount++;
}
}
}
LogHelper::log_info(t('Finalized @datasetCount dataset meta data configurations', array('@datasetCount' => $finalizedDatasetCount)));
return self::LOAD_STATE__SUCCESSFUL;
}
示例14: gd_dashboard_page_export
function gd_dashboard_page_export ( $dashboardNode ) {
// check to see if export is allowed
if ( !gd_dashboard_get_setting('export') ) {
LogHelper::log_notice('Exporting dashboards disabled globally.');
return MENU_NOT_FOUND;
}
if ( !gd_dashboard_access_view($dashboardNode) ) {
return MENU_ACCESS_DENIED;
}
$exporterPath = gd_dashboard_get_setting('export_tool_path');
$arguments = array();
$arguments[] = array (
'name' => '--title',
'value' => '\''.$dashboardNode->title.'\''
);
$callbackURL = GOVDASH_HOST;
if ( user_is_logged_in() || isset($_GET['oauth_consumer_key']) ) {
$callbackURL .= '/dashboards';
} else if ( gd_dashboard_is_public($dashboardNode) ) {
$callbackURL .= '/public/dashboards';
} else {
LogHelper::log_notice('Dashboard was requested anonymously but is not public. Requested: '.$dashboardNode->nid);
return MENU_NOT_FOUND;
}
$params = $_GET;
unset($params['q']);
$params['export-view'] = true;
$params['id'] = $dashboardNode->nid;
$callbackURL .= '?'.http_build_query($params,null,'&');
if ( !isset($_GET['oauth_consumer_key']) ) {
foreach ($_COOKIE as $key => $value) {
$arguments[] = array(
'name' => '--cookie',
'value' => '\'' . $key . '\' \'' . $value . '\''
);
}
}
$arguments[] = array (
'name' => '--user-style-sheet',
'value' => dirname(__FILE__) . '/css/export.css'
);
$arguments[] = array (
'name' => '--javascript-delay',
'value' => '5000'
);
$arguments[] = array (
'name' => '--page-size',
'value' => 'Letter'
);
$arguments[] = array (
'name' => '--header-html',
'value' => DRUPAL_ROOT.gd_dashboard_get_setting('export_header_path')
);
$arguments[] = array (
'name' => '--footer-html',
'value' => DRUPAL_ROOT.gd_dashboard_get_setting('export_footer_path')
);
$arguments[] = '--print-media-type';
$command = $exporterPath;
foreach ( $arguments as $arg ) {
if ( is_array($arg) ) {
$command .= ' ' . $arg['name'] . ' ' . escapeshellcmd($arg['value']);
} else {
$command .= ' '.escapeshellcmd($arg);
}
}
// url input
$command .= ' ' . escapeshellcmd($callbackURL);
// pdf output
$command .= ' -';
// stderr getting logged or tossed to black hole by default
$command .= ' 2>'.escapeshellcmd(gd_dashboard_get_setting('export_log_path'));
// keep oauth token out of logs.
if ( !isset($_GET['oauth_consumer_key']) ) {
LogHelper::log_debug($command);
}
// generate filename title
$filename = str_replace(' ','_',trim($dashboardNode->title));
$filename .= '__'.date('Ymd');
ob_start();
//.........这里部分代码省略.........
示例15: load
public function load(AbstractMetaModelFactory $factory, AbstractMetaModel $metamodel, array $filters = NULL, $finalAttempt)
{
LogHelper::log_notice(t('Loading Meta Model from configuration files ...'));
return parent::load($factory, $metamodel, $filters, $finalAttempt);
}