本文整理汇总了PHP中OA类的典型用法代码示例。如果您正苦于以下问题:PHP OA类的具体用法?PHP OA怎么用?PHP OA使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OA类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getAvailableSSLExtensions
/**
* A method to detect the available SSL enabling extensions
*
* @return mixed An array of the available extensions, or false if none is present
*/
public static function getAvailableSSLExtensions($forceReload = false)
{
if ($forceReload || !isset(self::$sslExtensions)) {
self::$sslExtensions = OA::getAvailableSSLExtensions();
}
return self::$sslExtensions;
}
开发者ID:Jaree,项目名称:revive-adserver,代码行数:12,代码来源:ConnectionUtils.php
示例2: 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;
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:37,代码来源:Statistics.php
示例3: 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);
}
}
开发者ID:Jaree,项目名称:revive-adserver,代码行数:30,代码来源:Auto.php
示例4: 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;
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:28,代码来源:postscript_install_testUpgrade.php
示例5: display
/**
* A method to launch and display the widget
*
* @param array $aParams The parameters array, usually $_REQUEST
*/
function display()
{
if (!$this->oTpl->is_cached()) {
OA::disableErrorHandling();
$oRss = new XML_RSS($this->url);
$result = $oRss->parse();
OA::enableErrorHandling();
// ignore bad character error which could appear if rss is using invalid characters
if (PEAR::isError($result)) {
if (!strstr($result->getMessage(), 'Invalid character')) {
PEAR::raiseError($result);
// rethrow
$this->oTpl->caching = false;
}
}
$aPost = array_slice($oRss->getItems(), 0, $this->posts);
foreach ($aPost as $key => $aValue) {
$aPost[$key]['origTitle'] = $aValue['title'];
if (strlen($aValue['title']) > 38) {
$aPost[$key]['title'] = substr($aValue['title'], 0, 38) . '...';
}
}
$this->oTpl->assign('title', $this->title);
$this->oTpl->assign('feed', $aPost);
$this->oTpl->assign('siteTitle', $this->siteTitle);
$this->oTpl->assign('siteUrl', $this->siteUrl);
}
$this->oTpl->display();
}
开发者ID:Jaree,项目名称:revive-adserver,代码行数:34,代码来源:Feed.php
示例6: execute
function execute($aParams)
{
$this->oUpgrade =& $aParams[0];
$this->oDbh =& OA_DB::singleton();
$prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];
if ($this->oDbh->dbsyntax == 'pgsql') {
$oTable =& $this->oUpgrade->oDBUpgrader->oTable;
foreach ($oTable->aDefinition['tables'] as $tableName => $aTable) {
foreach ($aTable['fields'] as $fieldName => $aField) {
if (!empty($aField['autoincrement'])) {
// Check actual sequence name
$oldSequenceName = $this->getLinkedSequence($prefix . $tableName, $fieldName);
if ($oldSequenceName) {
$newSequenceName = OA_DB::getSequenceName($this->oDbh, $tableName, $fieldName);
if ($oldSequenceName != $newSequenceName) {
$this->logOnly("Non standard sequence name found: " . $oldSequenceName);
$qTable = $this->oDbh->quoteIdentifier($prefix . $tableName, true);
$qField = $this->oDbh->quoteIdentifier($fieldName, true);
$qOldSequence = $this->oDbh->quoteIdentifier($oldSequenceName, true);
$qNewSequence = $this->oDbh->quoteIdentifier($newSequenceName, true);
OA::disableErrorHandling();
$result = $this->oDbh->exec("ALTER TABLE {$qOldSequence} RENAME TO {$qNewSequence}");
if (PEAR::isError($result)) {
if ($result->getCode() == MDB2_ERROR_ALREADY_EXISTS) {
$result = $this->oDbh->exec("DROP SEQUENCE {$qNewSequence}");
if (PEAR::isError($result)) {
$this->logError("Could not drop existing sequence {$newSequenceName}: " . $result->getUserInfo());
return false;
}
$result = $this->oDbh->exec("ALTER TABLE {$qOldSequence} RENAME TO {$qNewSequence}");
}
}
if (PEAR::isError($result)) {
$this->logError("Could not rename {$oldSequenceName} to {$newSequenceName}: " . $result->getUserInfo());
return false;
}
$result = $this->oDbh->exec("ALTER TABLE {$qTable} ALTER {$qField} SET DEFAULT nextval(" . $this->oDbh->quote($qNewSequence) . ")");
if (PEAR::isError($result)) {
$this->logError("Could not set column default to sequence {$newSequenceName}: " . $result->getUserInfo());
return false;
}
OA::enableErrorHandling();
$result = $oTable->resetSequenceByData($tableName, $fieldName);
if (PEAR::isError($result)) {
$this->logError("Could not reset sequence value for {$newSequenceName}: " . $result->getUserInfo());
return false;
}
$this->logOnly("Successfully renamed {$oldSequenceName} to {$newSequenceName}");
}
} else {
$this->logOnly("No sequence found for {$tableName}.{$fieldName}");
}
}
}
}
}
return true;
}
开发者ID:villos,项目名称:tree_admin,代码行数:58,代码来源:postscript_openads_upgrade_2.5.67-beta-rc8.php
示例7: __construct
function __construct($path, $server, $port = 0, $proxy = '', $proxy_port = 0, $proxy_user = '', $proxy_pass = '')
{
if ($aExtensions = OA::getAvailableSSLExtensions()) {
$this->hasCurl = in_array('curl', $aExtensions);
$this->hasOpenssl = in_array('openssl', $aExtensions);
}
$this->verifyPeer = false;
$this->caFile = MAX_PATH . '/etc/curl-ca-bundle.crt';
parent::__construct($path, $server, $port);
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:10,代码来源:XmlRpcClient.php
示例8: _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');
}
开发者ID:akirsch,项目名称:revive-adserver,代码行数:18,代码来源:SummariseFinal.php
示例9: 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);
}
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:17,代码来源:Runner.php
示例10: 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);
}
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:16,代码来源:ManageCampaigns.php
示例11: OA_XML_RPC_Client
function OA_XML_RPC_Client($path, $server, $port = 0, $proxy = '', $proxy_port = 0, $proxy_user = '', $proxy_pass = '')
{
if ($aExtensions = OA::getAvailableSSLExtensions()) {
$this->hasCurl = in_array('curl', $aExtensions);
$this->hasOpenssl = in_array('openssl', $aExtensions);
}
$this->verifyPeer = false;
// This CA file is reused in openXMarket plugin
// to setup curl in Zend_Http_Client_Adapter_Curl in same way as here
$this->caFile = MAX_PATH . '/etc/curl-ca-bundle.crt';
parent::XML_RPC_Client($path, $server, $port);
}
开发者ID:villos,项目名称:tree_admin,代码行数:12,代码来源:XmlRpcClient.php
示例12: 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;
}
开发者ID:akirsch,项目名称:revive-adserver,代码行数:20,代码来源:Factory.php
示例13: 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);
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:24,代码来源:AggregateBucketProcessingStrategyPgsql.php
示例14: 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;
}
开发者ID:Jaree,项目名称:revive-adserver,代码行数:24,代码来源:Max.php
示例15: testCheckOperationIntervalValue
/**
* A method to test the checkOperationIntervalValue() method.
*
*/
function testCheckOperationIntervalValue()
{
OA::disableErrorHandling();
for ($i = -1; $i <= 61; $i++) {
$result = OX_OperationInterval::checkOperationIntervalValue($i);
if ($i == 1 || $i == 2 || $i == 3 || $i == 4 || $i == 5 || $i == 6 || $i == 10 || $i == 12 || $i == 15 || $i == 20 || $i == 30 || $i == 60) {
$this->assertTrue($result);
} else {
$this->assertTrue(PEAR::isError($result));
}
$result = OX_OperationInterval::checkOperationIntervalValue(120);
$this->assertTrue(PEAR::isError($result));
}
OA::enableErrorHandling();
}
开发者ID:Jaree,项目名称:revive-adserver,代码行数:19,代码来源:OperationInterval.mtc.test.php
示例16: 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);
}
开发者ID:akirsch,项目名称:revive-adserver,代码行数:48,代码来源:Distributed.php
示例17: getConfigVersion
/**
* Returns phpAdsNew style config version.
*
* The OpenX version "number" is converted to an int using the following table:
*
* 'beta-rc' => 0.1
* 'beta' => 0.2
* 'rc' => 0.3
* '' => 0.4
*
* i.e.
* v0.3.29-beta-rc10 becomes:
* 0 * 1000 +
* 3 * 100 +
* 29 * 1 + // Cannot exceed 100 patch releases!
* 0.1 +
* 10 / 1000 =
* -------------
* 3293.1
*/
function getConfigVersion($version)
{
$a = array('dev' => -0.001, 'beta-rc' => 0.1, 'beta' => 0.2, 'rc' => 0.3, 'stable' => 0.4);
$version = OA::stripVersion($version, array('dev', 'stable'));
if (preg_match('/^v/', $version)) {
$v = preg_split('/[.-]/', substr($version, 1));
} else {
$v = preg_split('/[.-]/', $version);
}
if (count($v) < 3) {
return false;
}
// Prepare value from the first 3 items
$returnValue = $v[0] * 1000 + $v[1] * 100 + $v[2];
// How many items were there?
if (count($v) == 5) {
// Check that it is a beta-rc release
if (!$v[3] == 'beta' || !preg_match('/^rc(\\d+)/', $v[4], $aMatches)) {
return false;
}
// Add the beta-rc
$returnValue += $a['beta-rc'] + $aMatches[1] / 1000;
return $returnValue;
} else {
if (count($v) == 4) {
// Check that it is a tag or rc numer
if (isset($a[$v[3]])) {
// Add the beta
$returnValue += $a[$v[3]];
return $returnValue;
} else {
if (preg_match('/^rc(\\d+)/', $v[3], $aMatches)) {
// Add the rc
$returnValue += $a['rc'] + $aMatches[1] / 1000;
return $returnValue;
}
}
return false;
}
}
// Stable release
$returnValue += $a['stable'];
return $returnValue;
}
开发者ID:villos,项目名称:tree_admin,代码行数:64,代码来源:Sync.php
示例18: generateRecoveryId
/**
* Generate and save a recovery ID for a user
*
* @param int user ID
* @return array generated recovery ID
*/
function generateRecoveryId($userId)
{
$doPwdRecovery = OA_Dal::factoryDO('password_recovery');
// Make sure that recoveryId is unique in password_recovery table
do {
$recoveryId = strtoupper(md5(uniqid('', true)));
$recoveryId = substr(chunk_split($recoveryId, 8, '-'), -23, 22);
$doPwdRecovery->recovery_id = $recoveryId;
} while ($doPwdRecovery->find() > 0);
$doPwdRecovery = OA_Dal::factoryDO('password_recovery');
$doPwdRecovery->whereAdd('user_id = ' . DBC::makeLiteral($userId));
$doPwdRecovery->delete(true);
$doPwdRecovery = OA_Dal::factoryDO('password_recovery');
$doPwdRecovery->user_type = 'user';
$doPwdRecovery->user_id = $userId;
$doPwdRecovery->recovery_id = $recoveryId;
$doPwdRecovery->updated = OA::getNowUTC();
$doPwdRecovery->insert();
return $recoveryId;
}
开发者ID:villos,项目名称:tree_admin,代码行数:26,代码来源:PasswordRecovery.php
示例19: phpAds_userlogAdd
function phpAds_userlogAdd($action, $object, $details = '')
{
$oDbh =& OA_DB::singleton();
$conf = $GLOBALS['_MAX']['CONF'];
global $phpAds_Usertype;
if ($phpAds_Usertype != 0) {
$usertype = $phpAds_Usertype;
$userid = 0;
} else {
$usertype = phpAds_userAdministrator;
$userid = 0;
}
$now = strtotime(OA::getNow());
$query = "\n INSERT INTO\n " . $oDbh->quoteIdentifier($conf['table']['prefix'] . $conf['table']['userlog'], true) . "\n (\n timestamp,\n usertype,\n userid,\n action,\n object,\n details\n )\n VALUES\n (\n " . $oDbh->quote($now, 'integer') . ",\n " . $oDbh->quote($usertype, 'integer') . ",\n " . $oDbh->quote($userid, 'integer') . ",\n " . $oDbh->quote($action, 'integer') . ",\n " . $oDbh->quote($object, 'integer') . ",\n " . $oDbh->quote($details, 'text') . "\n )";
$res = $oDbh->exec($query);
if (PEAR::isError($res)) {
return $res;
}
return true;
}
开发者ID:villos,项目名称:tree_admin,代码行数:20,代码来源:lib-userlog.inc.php
示例20: 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;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:29,代码来源:Auth.php
注:本文中的OA类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论