本文整理汇总了PHP中CB\Config::setFlag方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::setFlag方法的具体用法?PHP Config::setFlag怎么用?PHP Config::setFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CB\Config
的用法示例。
在下文中一共展示了Config::setFlag方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* update file
* @param array $p optional properties. If not specified then $this-data is used
* @return boolean
*/
public function update($p = false)
{
//disable default log from parent Object class
\CB\Config::setFlag('disableActivityLog', true);
$rez = parent::update($p);
\CB\Config::setFlag('disableActivityLog', false);
$p =& $this->data;
$this->logAction('file_update', array('file' => array('id' => $p['id'], 'name' => $p['name'])));
return $rez;
}
示例2: update
/**
* update comment
* @param array $p optional properties. If not specified then $this-data is used
* @return boolean
*/
public function update($p = false)
{
//disable default log from parent Object class
//we'll set comments add as comment action for parent
Config::setFlag('disableActivityLog', true);
$rez = parent::update($p);
Config::setFlag('disableActivityLog', false);
$p =& $this->data;
$this->logAction('comment_update', array('new' => Objects::getCachedObject($p['pid']), 'comment' => $p['data']['_title']));
return $rez;
}
示例3: tearDown
protected function tearDown()
{
$_SESSION['user']['id'] = $this->oldValues['user_id'];
Config::setFlag('disableSolrIndexing', $this->oldValues['solrIndexing']);
if (empty($this->oldValues['userVerified'])) {
unset($_SESSION['verified']);
}
}
示例4: tearDown
protected function tearDown()
{
//remove users and objects
\CB\Config::setFlag('disableSolrIndexing', $this->oldValues['solrIndexing']);
if (empty($this->oldValues['userVerified'])) {
unset($_SESSION['verified']);
}
}
示例5: import
/**
* start importing process
* @return void
*/
public function import()
{
\CB\Config::setFlag('disableSolrIndexing', true);
\CB\Config::setFlag('disableActivityLog', true);
\CB\Config::setFlag('disableTriggers', true);
DB\startTransaction();
echo "\nInitializing .. \n____________________________\n";
$this->init();
echo "\nOk\n";
echo "\nPreparing .. \n____________________________\n";
$this->prepare();
echo "\nOk\n";
echo "\nExecuting .. \n____________________________\n";
$this->execute();
echo "\nOk\n";
echo "\nAdjusting .. \n____________________________\n";
$this->adjust();
echo "\nOk\n";
\CB\Config::setFlag('disableTriggers', false);
\CB\Config::setFlag('disableActivityLog', false);
\CB\Config::setFlag('disableSolrIndexing', false);
DB\commitTransaction();
echo "\nReindexing .. \n____________________________\n";
$this->reindex();
echo "\nOk\n";
}
示例6: ini_set
Note: there is no need to run any reindexing
All new actions will generate notifications based on followers data
*/
use CB\DB;
ini_set('max_execution_time', 0);
$path = realpath(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'crons' . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
//check script options
$options = getopt('c:', array('core'));
$core = empty($options['c']) ? @$options['core'] : $options['c'];
if (empty($core)) {
die('no core specified or invalid options set.');
}
$cron_id = 'dummy';
include $path . 'init.php';
\CB\Config::setFlag('disableActivityLog', true);
//select tasks count
$res = DB\dbQuery('SELECT count(*) `nr`
FROM objects
WHERE `sys_data` LIKE \'%"subscribers"%\'') or die(DB\dbQueryError());
if ($r = $res->fetch_assoc()) {
echo "Total objects: " . $r['nr'] . "\n";
}
$res->close();
DB\startTransaction();
//iterate and upgrade each object
$i = 0;
$res = DB\dbQuery('SELECT id, sys_data
FROM objects
WHERE `sys_data` LIKE \'%"subscribers"%\'') or die(DB\dbQueryError());
while ($r = $res->fetch_assoc()) {
示例7: update
/**
* update file
* @param array $p optional properties. If not specified then $this-data is used
* @return boolean
*/
public function update($p = false)
{
//disable default log from parent Object class
Config::setFlag('disableActivityLog', true);
$rez = parent::update($p);
Config::setFlag('disableActivityLog', false);
$p =& $this->data;
// log the action
$logParams = array('type' => 'file_update', 'new' => Objects::getCachedObject($p['pid']), 'file' => array('id' => $p['id'], 'name' => $p['name']));
Log::add($logParams);
return $rez;
}