/** * 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; }
/** * 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; }
protected function tearDown() { $_SESSION['user']['id'] = $this->oldValues['user_id']; Config::setFlag('disableSolrIndexing', $this->oldValues['solrIndexing']); if (empty($this->oldValues['userVerified'])) { unset($_SESSION['verified']); } }
protected function tearDown() { //remove users and objects \CB\Config::setFlag('disableSolrIndexing', $this->oldValues['solrIndexing']); if (empty($this->oldValues['userVerified'])) { unset($_SESSION['verified']); } }
/** * 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"; }
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()) {
/** * 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; }