本文整理汇总了PHP中OA::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP OA::debug方法的具体用法?PHP OA::debug怎么用?PHP OA::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OA
的用法示例。
在下文中一共展示了OA::debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPlacementFirstStatsDate
/**
* A method to determine the day/hour that a placement first became active,
* based on the first record of its children ads delivering.
*
* @param integer $placementId The placement ID.
* @return mixed PEAR:Error on database error, null on no result, or a
* PEAR::Date object representing the time the placement started
* delivery, or, if not yet active, the current date/time.
*/
function getPlacementFirstStatsDate($placementId)
{
// Test the input values
if (!is_numeric($placementId)) {
return null;
}
// Get the required data
$conf = $GLOBALS['_MAX']['CONF'];
$adTable = $this->oDbh->quoteIdentifier($conf['table']['prefix'] . $conf['table']['banners'], true);
$dsahTable = $this->oDbh->quoteIdentifier($conf['table']['prefix'] . $conf['table']['data_summary_ad_hourly'], true);
$query = "\n SELECT\n DATE_FORMAT(dsah.date_time, '%Y-%m-%d') AS day,\n HOUR(dsah.date_time) AS hour\n FROM\n {$adTable} AS a,\n {$dsahTable} AS dsah\n WHERE\n a.campaignid = " . $this->oDbh->quote($placementId, 'integer') . "\n AND\n a.bannerid = dsah.ad_id\n ORDER BY\n day ASC, hour ASC\n LIMIT 1";
$message = "Finding start date of placement ID {$placementId} based on delivery statistics.";
OA::debug($message, PEAR_LOG_DEBUG);
$rc = $this->oDbh->query($query);
if (PEAR::isError($rc)) {
return $rc;
}
// Was a result found?
if ($rc->numRows() == 0) {
// Return the current time
$oDate = new Date();
} else {
// Store the results
$aRow = $rc->fetchRow();
$oDate = new Date($aRow['day'] . ' ' . $aRow['hour'] . ':00:00');
}
return $oDate;
}
示例2: run
function run()
{
// Make sure that the output is sent to the browser before
// loading libraries and connecting to the db
flush();
$aConf = $GLOBALS['_MAX']['CONF'];
// Set longer time out, and ignore user abort
if (!ini_get('safe_mode')) {
@set_time_limit($aConf['maintenance']['timeLimitScripts']);
@ignore_user_abort(true);
}
if (!defined('OA_VERSION')) {
// If the code is executed inside delivery, the constants
// need to be initialized
require_once MAX_PATH . '/constants.php';
setupConstants();
}
$oLock =& OA_DB_AdvisoryLock::factory();
if ($oLock->get(OA_DB_ADVISORYLOCK_MAINTENANCE)) {
OA::debug('Running Automatic Maintenance Task', PEAR_LOG_INFO);
OA_Preferences::loadAdminAccountPreferences();
require_once LIB_PATH . '/Maintenance.php';
$oMaint = new OX_Maintenance();
$oMaint->run();
$oLock->release();
OA::debug('Automatic Maintenance Task Completed', PEAR_LOG_INFO);
} else {
OA::debug('Automatic Maintenance Task not run: could not acquire lock', PEAR_LOG_INFO);
}
}
示例3: defaultData
function defaultData()
{
$oManager = new OX_Plugin_ComponentGroupManager();
if (!array_key_exists('testPlugin', $GLOBALS['_MAX']['CONF']['pluginGroupComponents'])) {
$oManager->disableComponentGroup('testPlugin');
}
$this->oManager->enableComponentGroup('testPlugin');
$oTestPluginTable = OA_Dal::factoryDO('testplugin_table');
if (!$oTestPluginTable) {
OA::debug('Failed to instantiate DataObject for testplugin_table');
return false;
}
$oTestPluginTable->myplugin_desc = 'Hello World';
$aSettings[0]['data'] = $oTestPluginTable->insert();
$aSettings[0]['section'] = 'myPlugin';
$aSettings[0]['key'] = 'english';
$oTestPluginTable->myplugin_desc = 'Hola Mundo';
$aSettings[1]['data'] = $oTestPluginTable->insert();
$aSettings[1]['section'] = 'myPlugin';
$aSettings[1]['key'] = 'spanish';
$oTestPluginTable->myplugin_desc = 'Look Simon, you\'re just making it up now';
$aSettings[2]['data'] = $oTestPluginTable->insert();
$aSettings[2]['section'] = 'myPlugin';
$aSettings[2]['key'] = 'russian';
$oManager->_registerSettings($aSettings);
$oManager->disableComponentGroup('testPlugin');
return true;
}
示例4: _saveSummary
/**
* A private method for summarising data into the final tables when
* at least one hour is complete.
*
* @access private
* @param PEAR::Date $oStartDate The start date of the complete hour(s).
* @param PEAR::Date $oEndDate The end date of the complete hour(s).
*/
function _saveSummary($oStartDate, $oEndDate)
{
$message = '- Updating the data_summary_ad_hourly table for data after ' . $oStartDate->format('%Y-%m-%d %H:%M:%S') . ' ' . $oStartDate->tz->getShortName();
$this->oController->report .= $message . ".\n";
OA::debug($message, PEAR_LOG_DEBUG);
$oServiceLocator =& OA_ServiceLocator::instance();
$oDal =& $oServiceLocator->get('OX_Dal_Maintenance_Statistics');
$aTypes = array('types' => array(0 => 'request', 1 => 'impression', 2 => 'click'), 'connections' => array(1 => MAX_CONNECTION_AD_IMPRESSION, 2 => MAX_CONNECTION_AD_CLICK));
$oDal->saveSummary($oStartDate, $oEndDate, $aTypes, 'data_intermediate_ad', 'data_summary_ad_hourly');
}
示例5: runTasks
/**
* A method to run the run() method of each task in the collection,
* in the registered order.
*
* @todo We should really make OA_Task::run return a boolean we can check.
*/
function runTasks()
{
// Remove tasks from the queue and unset them when done to prevent
// useless memory consumption
while ($oTask = array_shift($this->aTasks)) {
OA::debug('Task begin: ' . get_class($oTask), PEAR_LOG_INFO);
$oTask->run();
OA::debug('Task complete: ' . get_class($oTask), PEAR_LOG_INFO);
unset($oTask);
}
}
示例6: run
/**
* The implementation of the OA_Task::run() method that performs
* the required task of activating/deactivating campaigns.
*/
function run()
{
if ($this->oController->updateIntermediate) {
$oServiceLocator =& OA_ServiceLocator::instance();
$oDate =& $oServiceLocator->get('now');
$oDal =& $oServiceLocator->get('OX_Dal_Maintenance_Statistics');
$message = '- Managing (activating/deactivating) campaigns';
$this->oController->report .= "{$message}.\n";
OA::debug($message);
$this->report .= $oDal->manageCampaigns($oDate);
}
}
示例7: pruneBucket
/**
* A method to prune a bucket of all records up to and
* including the timestamp given.
*
* @param Date $oEnd Prune until this interval_start (inclusive).
* @param Date $oStart Only prune before this interval_start date (inclusive)
* as well. Optional.
* @return mixed Either the number of rows pruned, or an MDB2_Error objet.
*/
public function pruneBucket($oBucket, $oEnd, $oStart = null)
{
$sTableName = $oBucket->getBucketTableName();
if (!is_null($oStart)) {
OA::debug(' - Pruning the ' . $sTableName . ' table for data with operation interval start between ' . $oStart->format('%Y-%m-%d %H:%M:%S') . ' ' . $oStart->tz->getShortName() . ' and ' . $oEnd->format('%Y-%m-%d %H:%M:%S') . ' ' . $oEnd->tz->getShortName(), PEAR_LOG_DEBUG);
} else {
OA::debug(' - Pruning the ' . $sTableName . ' table for all data with operation interval start equal to or before ' . $oEnd->format('%Y-%m-%d %H:%M:%S') . ' ' . $oEnd->tz->getShortName(), PEAR_LOG_DEBUG);
}
$query = "\n DELETE FROM\n {$sTableName}\n WHERE\n interval_start <= " . DBC::makeLiteral($oEnd->format('%Y-%m-%d %H:%M:%S'));
if (!is_null($oStart)) {
$query .= "\n AND\n interval_start >= " . DBC::makeLiteral($oStart->format('%Y-%m-%d %H:%M:%S'));
}
$oDbh = OA_DB::singleton();
return $oDbh->exec($query);
}
示例8: raiseError
/**
* A method to invoke errors.
*
* @static
* @param mixed $message A string error message, or a {@link PEAR_Error} object.
* @param integer $type A custom message code - see the {@link setupConstants()} function.
* @param integer $behaviour Optional behaviour (i.e. PEAR_ERROR_DIE to halt on this error).
* @return PEAR_Error $error A (@link PEAR_Error} object.
*/
function raiseError($message, $type = null, $behaviour = null)
{
// If fatal
if ($behaviour == PEAR_ERROR_DIE) {
// Log fatal message here as execution will stop
$errorType = MAX::errorConstantToString($type);
if (!is_string($message)) {
$message = print_r($message, true);
}
OA::debug($type . ' :: ' . $message, PEAR_LOG_EMERG);
exit;
}
$error = PEAR::raiseError($message, $type, $behaviour);
return $error;
}
示例9: deriveClassName
/**
* A method to derive the class name to instantiate.
*
* @return string The name of the class object to create.
*/
function deriveClassName()
{
$aConf = $GLOBALS['_MAX']['CONF'];
$filename = ucfirst(strtolower($aConf['database']['type']));
$classname = 'OX_Dal_Maintenance_Statistics_' . $filename;
$includeFile = LIB_PATH . "/Dal/Maintenance/Statistics/{$filename}.php";
require_once $includeFile;
if (!class_exists($classname)) {
// Unable to include the specified class file - raise error and halt
OA::debug('Unable to find the "' . $classname . '" class in the "' . $includeFile . '" file.', PEAR_LOG_ERR);
OA::debug('Aborting script execution', PEAR_LOG_ERR);
exit;
}
return $classname;
}
示例10: run
/**
* A method to run distributed maintenance.
*/
function run()
{
if (empty($GLOBALS['_MAX']['CONF']['lb']['enabled'])) {
OA::debug('Distributed stats disabled, not running Maintenance Distributed Engine', PEAR_LOG_INFO);
return;
}
if (!empty($GLOBALS['_MAX']['CONF']['rawDatabase'])) {
$GLOBALS['_MAX']['CONF']['database'] = $GLOBALS['_MAX']['CONF']['rawDatabase'] + $GLOBALS['_MAX']['CONF']['database'];
OA::debug('rawDatabase functionality is being used, switching settings', PEAR_LOG_INFO);
}
$oLock =& OA_DB_AdvisoryLock::factory();
if (!$oLock->get(OA_DB_ADVISORYLOCK_DISTRIBUTED)) {
OA::debug('Maintenance Distributed Engine Already Running', PEAR_LOG_INFO);
return;
}
OA::debug('Running Maintenance Distributed Engine', PEAR_LOG_INFO);
// Attempt to increase PHP memory
OX_increaseMemoryLimit(OX_getMinimumRequiredMemory('maintenance'));
// Ensure the current time is registered with the OA_ServiceLocator
$oServiceLocator =& OA_ServiceLocator::instance();
$oNow =& $oServiceLocator->get('now');
if (!$oNow) {
// Record the current time, and register with the OA_ServiceLocator
$oNow = new Date();
$oServiceLocator->register('now', $oNow);
}
OA::debug(' - Current time is ' . $oNow->format('%Y-%m-%d %H:%M:%S') . ' ' . $oNow->tz->getShortName(), PEAR_LOG_DEBUG);
// Get the components of the deliveryLog extension
$aBuckets = OX_Component::getComponents('deliveryLog');
// Copy buckets' records with "interval_start" up to and including previous OI start,
// and then prune the data processed
$aPreviousOperationIntervalDates = OX_OperationInterval::convertDateToPreviousOperationIntervalStartAndEndDates($oNow);
OA::debug(' - Will process data for all operation intervals before and up to start', PEAR_LOG_DEBUG);
OA::debug(' time of ' . $aPreviousOperationIntervalDates['start']->format('%Y-%m-%d %H:%M:%S') . ' ' . $aPreviousOperationIntervalDates['start']->tz->getShortName(), PEAR_LOG_DEBUG);
foreach ($aBuckets as $sBucketName => $oBucketClass) {
if ($oBucketClass->testStatisticsMigration($oBucketClass->getStatisticsMigration())) {
$oBucketClass->processBucket($aPreviousOperationIntervalDates['start']);
$oBucketClass->pruneBucket($aPreviousOperationIntervalDates['start']);
} else {
OA::debug(' - Skipping ' . $sBucketName, PEAR_LOG_DEBUG);
}
}
$oLock->release();
OA::debug('Maintenance Distributed Engine Completed', PEAR_LOG_INFO);
}
示例11: staticGetAuthPlugin
/**
* Returns authentication plugin
*
* @static
* @param string $authType
* @return Plugins_Authentication
*/
static function staticGetAuthPlugin()
{
static $authPlugin;
static $authPluginType;
if (!isset($authPlugin) || $authPluginType != $authType) {
$aConf = $GLOBALS['_MAX']['CONF'];
if (!empty($aConf['authentication']['type'])) {
$authType = $aConf['authentication']['type'];
$authPlugin = OX_Component::factoryByComponentIdentifier($authType);
}
if (!$authPlugin) {
// Fall back to internal
$authType = 'none';
$authPlugin = new Plugins_Authentication();
}
if (!$authPlugin) {
OA::debug('Error while including authentication plugin and unable to fallback', PEAR_LOG_ERR);
}
$authPluginType = $authType;
}
return $authPlugin;
}
示例12: getConfig
/**
* A method to read and parse the configuration file for a plugin.
*
* @static
* @param string $module The plugin module name (i.e. /plugins/module directory).
* @param string $package An optional plugin package name (i.e. /plugins/module/package
* directory). If not given, the module level configuration file
* will be read.
* @param string $name An optional plugin name (i.e. /plugins/module/package/plugin.plugin.php).
* If not given, the package level configuration file will be read, or
* the module level configuration file will be read, depending on the
* $package parameter.
* @param boolean $processSections Process section names in the configuration file, and return
* as a multidimenstional array.
* {@see http://uk.php.net/manual/en/function.parse-ini-file.php}.
* @param boolean $copyDefaultIfNotExists If true, copy the default configuration file for the
* plugin to the real configuration file location, if the
* real configuration file does not (yet) exist.
* @return mixed An array containing the parsed configuration file, or false on error.
*
*/
function getConfig($module, $package = null, $name = null, $processSections = false, $copyDefaultIfNotExists = true)
{
// First lets see if the config is saved in our global config file
$conf = isset($GLOBALS['_MAX']['CONF'][$module]) ? $GLOBALS['_MAX']['CONF'][$module] : false;
if (!empty($package)) {
$conf = isset($conf[$package]) ? $conf[$package] : false;
}
// Try plugin config
if ($conf === false) {
$configFileName = MAX_Plugin::getConfigFileName($module, $package, $name);
$conf = MAX_Plugin::getConfigByFileName($configFileName, $processSections, false);
}
if ($conf !== false) {
return $conf;
}
if ($copyDefaultIfNotExists) {
MAX_Plugin::copyDefaultConfig($module, $package, $name);
$defaultConfigFileName = MAX_Plugin::getConfigFileName($module, $package, $name, true);
return MAX_Plugin::getConfigByFileName($defaultConfigFileName, $processSections, false);
}
OA::debug("Config for {$package}/{$module}/{$name} does not exist.", MAX_ERROR_NOFILE);
return false;
}
示例13: rejectEmptyVarConversions
/**
* A method to reject conversions which variables which are required to be
* non-empty, but which are in reality, empty, between the supplied operation
* interval start and end dates.
*
* @param PEAR::Date $oStart The start date/time of the operation interval.
* @param PEAR::Date $oEnd The end date/time of the operation interval.
*/
function rejectEmptyVarConversions($oStart, $oEnd)
{
$aConf = $GLOBALS['_MAX']['CONF'];
$query = "\n UPDATE\n {$aConf['table']['prefix']}{$aConf['table']['data_intermediate_ad_connection']} AS diac\n JOIN\n {$aConf['table']['prefix']}{$aConf['table']['variables']} AS v\n ON\n (\n diac.tracker_id = v.trackerid\n )\n LEFT JOIN\n {$aConf['table']['prefix']}{$aConf['table']['data_intermediate_ad_variable_value']} AS diavv\n ON\n (\n diac.data_intermediate_ad_connection_id = diavv.data_intermediate_ad_connection_id\n AND\n v.variableid = diavv.tracker_variable_id\n )\n SET\n diac.connection_status = " . MAX_CONNECTION_STATUS_DISAPPROVED . ",\n diac.updated = '" . OA::getNow() . "',\n diac.comments = CONCAT('Rejected because ', COALESCE(NULLIF(v.description, ''), v.name), ' is empty')\n WHERE\n diac.tracker_date_time >= " . $this->oDbh->quote($oStart->format('%Y-%m-%d %H:%M:%S'), 'timestamp') . "\n AND\n diac.tracker_date_time <= " . $this->oDbh->quote($oEnd->format('%Y-%m-%d %H:%M:%S'), 'timestamp') . "\n AND\n diac.inside_window = 1\n AND\n v.reject_if_empty = 1\n AND\n (diavv.value IS NULL OR diavv.value = '')\n ";
$message = '- Rejecting conversions with empty required variables between ' . $oStart->format('%Y-%m-%d %H:%M:%S') . ' ' . $oStart->tz->getShortName() . ' and ' . $oEnd->format('%Y-%m-%d %H:%M:%S') . ' ' . $oEnd->tz->getShortName();
OA::debug($message, PEAR_LOG_DEBUG);
$rows = $this->oDbh->exec($query);
if (PEAR::isError($rows)) {
return MAX::raiseError($rows, MAX_ERROR_DBFAILURE, PEAR_ERROR_DIE);
}
}
示例14: manageCampaigns
/**
* A method to activate/deactivate campaigns, based on the date and/or the inventory
* requirements (impressions, clicks and/or conversions). Also sends email reports
* for any campaigns that are activated/deactivated, as well as sending email reports
* for any campaigns that are likely to expire in the near future.
*
* @param Date $oDate The current date/time.
* @return string Report on the campaigns activated/deactivated.
*/
function manageCampaigns($oDate)
{
$aConf = $GLOBALS['_MAX']['CONF'];
$oServiceLocator =& OA_ServiceLocator::instance();
$oEmail =& $oServiceLocator->get('OA_Email');
if ($oEmail === false) {
$oEmail = new OA_Email();
$oServiceLocator->register('OA_Email', $oEmail);
}
$report = "\n";
// Select all campaigns in the system, where:
// The campaign is ACTIVE and:
// - The end date stored for the campaign is not null; or
// - The campaign has a lifetime impression, click or conversion
// target set.
//
// That is:
// - It is possible for the active campaign to be automatically
// stopped, as it has a valid end date. (No limitations are
// applied to those campaigns tested, as the ME may not have
// run for a while, and if so, even campaigns with an end date
// of many, many weeks ago should be tested to ensure they are
// [belatedly] halted.)
// - It is possible for the active campaign to be automatically
// stopped, as it has at leaast one lifetime target that could
// have been reached.
//
// The campaign is INACTIVE and:
// - The start date stored for the campaign is not null; and
// - The weight is greater than zero; and
// - The end date stored for the campaign is either null, or is
// greater than "today" less one day.
//
// That is:
// - It is possible for the inactive campaign to be automatically
// started, as it has a valid start date. (No limitations are
// applied to those campaigns tested, as the ME may not have run
// for a while, and if so, even campaigns with an activation date
// of many, many weeks ago should be tested to ensure they are
// [belatedy] enabled.)
// - The campaign is not in a permanently inactive state, as a
// result of the weight being less then one, which means that
// it cannot be activated.
// - The test to start the campaign is unlikely to fail on account
// of the end date. (Inactive campaigns with start dates may have
// passed the start date, but they may also have passed the end
// date - unfortunately, because the dates are not stored in UTC,
// it's not possible to know exactly which campaigns have passed
// the end date or not, until the values are converted to UTC based
// on the Advertiser Account timezone preference - so it's necessary
// to get some campaigns that might be passed the end date, and do
// the converstion to UTC and test to check.)
$prefix = $this->getTablePrefix();
$oYesterdayDate = new Date();
$oYesterdayDate->copy($oDate);
$oYesterdayDate->subtractSeconds(SECONDS_PER_DAY);
$query = "\n SELECT\n cl.clientid AS advertiser_id,\n cl.account_id AS advertiser_account_id,\n cl.agencyid AS agency_id,\n cl.contact AS contact,\n cl.email AS email,\n cl.reportdeactivate AS send_activate_deactivate_email,\n ca.campaignid AS campaign_id,\n ca.campaignname AS campaign_name,\n ca.views AS targetimpressions,\n ca.clicks AS targetclicks,\n ca.conversions AS targetconversions,\n ca.status AS status,\n ca.activate AS start,\n ca.expire AS end\n FROM\n {$prefix}campaigns AS ca,\n {$prefix}clients AS cl\n WHERE\n ca.clientid = cl.clientid\n AND\n ca.status = " . $this->oDbh->quote(OA_ENTITY_STATUS_RUNNING, 'integer') . "\n AND\n (\n ca.expire " . OA_Dal::notEqualNoDateString() . "\n OR\n (\n ca.views > 0\n OR\n ca.clicks > 0\n OR\n ca.conversions > 0\n )\n )\n UNION ALL\n SELECT\n cl.clientid AS advertiser_id,\n cl.account_id AS advertiser_account_id,\n cl.agencyid AS agency_id,\n cl.contact AS contact,\n cl.email AS email,\n cl.reportdeactivate AS send_activate_deactivate_email,\n ca.campaignid AS campaign_id,\n ca.campaignname AS campaign_name,\n ca.views AS targetimpressions,\n ca.clicks AS targetclicks,\n ca.conversions AS targetconversions,\n ca.status AS status,\n ca.activate AS start,\n ca.expire AS end\n FROM\n {$prefix}campaigns AS ca,\n {$prefix}clients AS cl\n WHERE\n ca.clientid = cl.clientid\n AND\n ca.status != " . $this->oDbh->quote(OA_ENTITY_STATUS_RUNNING, 'integer') . "\n AND\n ca.activate " . OA_Dal::notEqualNoDateString() . "\n AND\n (\n ca.weight > 0\n OR\n ca.priority > 0\n )\n AND\n (\n ca.expire >= " . $this->oDbh->quote($oYesterdayDate->format('%Y-%m-%d'), 'timestamp') . "\n OR\n ca.expire " . OA_Dal::equalNoDateString() . "\n )\n ORDER BY\n advertiser_id";
$rsResult = $this->oDbh->query($query);
if (PEAR::isError($rsResult)) {
return MAX::raiseError($rsResult, MAX_ERROR_DBFAILURE, PEAR_ERROR_DIE);
}
OA::debug('- Found ' . $rsResult->numRows() . ' campaigns to test for activation/deactivation', PEAR_LOG_DEBUG);
while ($aCampaign = $rsResult->fetchRow()) {
if ($aCampaign['status'] == OA_ENTITY_STATUS_RUNNING) {
// The campaign is currently running, look at the campaign
$disableReason = 0;
$canExpireSoon = false;
if ($aCampaign['targetimpressions'] > 0 || $aCampaign['targetclicks'] > 0 || $aCampaign['targetconversions'] > 0) {
// The campaign has an impression, click and/or conversion target,
// so get the sum total statistics for the campaign
$query = "\n SELECT\n SUM(dia.impressions) AS impressions,\n SUM(dia.clicks) AS clicks,\n SUM(dia.conversions) AS conversions\n FROM\n " . $this->oDbh->quoteIdentifier($aConf['table']['prefix'] . $aConf['table']['data_intermediate_ad'], true) . " AS dia,\n " . $this->oDbh->quoteIdentifier($aConf['table']['prefix'] . $aConf['table']['banners'], true) . " AS b\n WHERE\n dia.ad_id = b.bannerid\n AND b.campaignid = {$aCampaign['campaign_id']}";
$rsResultInner = $this->oDbh->query($query);
$valuesRow = $rsResultInner->fetchRow();
if (!is_null($valuesRow['impressions']) || !is_null($valuesRow['clicks']) || !is_null($valuesRow['conversions'])) {
// There were impressions, clicks and/or conversions for this
// campaign, so find out if campaign targets have been passed
if (is_null($valuesRow['impressions'])) {
// No impressions
$valuesRow['impressions'] = 0;
}
if (is_null($valuesRow['clicks'])) {
// No clicks
$valuesRow['clicks'] = 0;
}
if (is_null($valuesRow['conversions'])) {
// No conversions
$valuesRow['conversions'] = 0;
}
if ($aCampaign['targetimpressions'] > 0) {
if ($aCampaign['targetimpressions'] <= $valuesRow['impressions']) {
// The campaign has an impressions target, and this has been
//.........这里部分代码省略.........
示例15:
/**
* Returns a child with a given id. If user have no access to this section
* or if the child does not exists null is returned
*
* @param string $sectionId
* @return OA_Admin_Menu_Section
*/
function &get($sectionId, $checkAccess = true)
{
if (!isset($this->aSectionsMap[$sectionId])) {
$errMsg = "MenuSection::get() Cannot get section. No such section with id '" . $sectionId . "'";
OA::debug($errMsg, PEAR_LOG_WARNING);
return null;
}
$oChildSection =& $this->aSectionsMap[$sectionId];
if ($checkAccess) {
if (!$oChildSection->check()) {
$oChildSection = null;
}
}
return $oChildSection;
}