本文整理匯總了PHP中It::debug方法的典型用法代碼示例。如果您正苦於以下問題:PHP It::debug方法的具體用法?PHP It::debug怎麽用?PHP It::debug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類It
的用法示例。
在下文中一共展示了It::debug方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
public function run($args)
{
// don't run backup at the most busy minutes
if (in_array(date('i'), array('00', '01', '15', '16', '30', '31', '45', '46'))) {
return;
}
if (Yii::app()->mutex->lock('BackupOldData', 60 * 60)) {
try {
$obj = new BackupOldData();
$obj->run();
} catch (Exception $e) {
It::debug('BackupOldDataCommand: backup old data process was failed: ' . $e->getMessage(), 'backup_database');
}
Yii::app()->mutex->unlock();
}
}
示例2: copyDataBetweenDatabases
/**
* Copy old data from actula database to backup database
*
* @param type $limit_timestamp
*/
private function copyDataBetweenDatabases($limit_timestamp)
{
$completed = true;
$refresh_data = $this->updateMainStationInformation();
if ($refresh_data) {
$this->addBackupLog("Refresh info about stations, sensors, features.");
foreach ($refresh_data as $sql) {
$res = $this->db_conn->createCommand($sql)->query();
}
}
// table 'listener_log' dependances
$res = $this->prepareListenerLogInserts($limit_timestamp);
$listener_log_ids = $res[0];
$inserts_listener_log = $res[1];
if (count($listener_log_ids)) {
$inserts_listener_log_dependant = $this->prepareListenerLogDependantInserts($listener_log_ids);
$completed = false;
}
// table 'listener' dependances
$res = $this->prepareListenerInserts($limit_timestamp);
$listener_ids = $res[0];
$inserts_listener = $res[1];
if (count($listener_ids)) {
$inserts_listener_dependant = $this->prepareListenerDependantInserts($listener_ids);
$completed = false;
}
if ($inserts_listener_log) {
$res = $this->db_conn->createCommand($inserts_listener_log)->query();
$completed = false;
}
if ($inserts_listener_log_dependant) {
foreach ($inserts_listener_log_dependant as $sql) {
$res = $this->db_conn->createCommand($sql)->query();
}
$completed = false;
}
if ($inserts_listener) {
$res = $this->db_conn->createCommand($inserts_listener)->query();
}
if ($inserts_listener_dependant) {
foreach ($inserts_listener_dependant as $sql) {
$res = $this->db_conn->createCommand($sql)->query();
}
}
if ($listener_ids) {
$this->removeDataByIds('listener', $listener_ids);
}
if ($listener_log_ids) {
$this->removeDataByIds('listener_log', $listener_log_ids);
}
if (count($listener_ids) >= 50 || count($listener_log_ids) >= 50) {
$completed = false;
}
if ($completed) {
$this->addBackupLog("Backup for this date is completed.");
It::debug("copyDataBetweenDatabases (19)", 'backup_database');
$res = $this->removeDataBeforeDate($limit_timestamp);
It::debug("copyDataBetweenDatabases (20)", 'backup_database');
$this->current_backup->completed = '1';
$this->current_backup->save();
} else {
$this->addBackupLog("Backup for this date is not completed yet. Continue in a few minutes.");
}
}