本文整理汇总了PHP中AEUtilLogger::ResetLog方法的典型用法代码示例。如果您正苦于以下问题:PHP AEUtilLogger::ResetLog方法的具体用法?PHP AEUtilLogger::ResetLog怎么用?PHP AEUtilLogger::ResetLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AEUtilLogger
的用法示例。
在下文中一共展示了AEUtilLogger::ResetLog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepare
protected function _prepare()
{
// Intialize the timer class
$timer = AEFactory::getTimer();
// Do we have a tag?
if (!empty($this->_parametersArray['tag'])) {
$this->tag = $this->_parametersArray['tag'];
}
// Make sure a tag exists (or create a new one)
$this->tag = $this->getTag();
// Reset the log
AEUtilLogger::openLog($this->tag);
AEUtilLogger::ResetLog($this->tag);
set_error_handler('akeebaBackupErrorHandler');
// Reset the storage
AEUtilTempvars::reset($this->tag);
// Get the domain chain
$this->domain_chain = AEUtilScripting::getDomainChain();
$this->total_steps = count($this->domain_chain) - 1;
// Init shouldn't count in the progress bar
// Mark this engine for Nesting Logging
$this->nest_logging = true;
// Preparation is over
$this->array_cache = null;
$this->setState('prepared');
//restore_error_handler();
}
示例2: _prepare
protected function _prepare()
{
// Intialize the timer class
$timer = AEFactory::getTimer();
// Do we have a tag?
if (!empty($this->_parametersArray['tag'])) {
$this->tag = $this->_parametersArray['tag'];
}
// Make sure a tag exists (or create a new one)
$this->tag = $this->getTag();
// Reset the log
$logTag = $this->getLogTag();
AEUtilLogger::openLog($logTag);
AEUtilLogger::ResetLog($logTag);
set_error_handler('akeebaBackupErrorHandler');
// Reset the storage
$tempVarsTag = $this->tag . (empty($this->backup_id) ? '' : '.' . $this->backup_id);
AEUtilTempvars::reset($tempVarsTag);
// Apply the configuration overrides
$overrides = AEPlatform::getInstance()->configOverrides;
if (is_array($overrides) && @count($overrides)) {
$registry = AEFactory::getConfiguration();
$protected_keys = $registry->getProtectedKeys();
$registry->resetProtectedKeys();
foreach ($overrides as $k => $v) {
$registry->set($k, $v);
}
$registry->setProtectedKeys($protected_keys);
}
// Get the domain chain
$this->domain_chain = AEUtilScripting::getDomainChain();
$this->total_steps = count($this->domain_chain) - 1;
// Init shouldn't count in the progress bar
// Mark this engine for Nesting Logging
$this->nest_logging = true;
// Preparation is over
$this->array_cache = null;
$this->setState('prepared');
//restore_error_handler();
}
示例3: __construct
public function __construct(& $subject, $config = array())
{
// Use the parent constructor to create the plugin object
parent::__construct($subject, $config);
// Check if we have to disable ourself
$akreset = JRequest::getCmd('akreset','');
$defaultpw = $this->params->get('resetpw','');
if( ($akreset == $defaultpw) && !empty($defaultpw) )
{
// Disable the plugin
$db = JFactory::getDBO();
if( version_compare( JVERSION, '1.6.0', 'ge' ) ) {
$sql = 'UPDATE `#__extensions` SET `enabled` = 0 WHERE `type` = \'plugin\' AND `element` = \'aklazy\'';
} else {
$sql = 'UPDATE #__plugins SET `published` = 0 WHERE `element` = \'aklazy\'';
}
$db->setQuery($sql);
$db->query();
// Load the configuration
$profile = (int)$this->params->get('profile',1);
if($profile <= 0) $profile = 1;
$session = JFactory::getSession();
$session->set('profile', $profile, 'akeeba');
AEPlatform::getInstance()->load_configuration($profile);
// Remove the log files
$logfile = AEUtilLogger::logName(null);
@unlink($logfile);
AEUtilLogger::ResetLog('lazy');
// Clear lock
$this->unsetLock();
$this->unsetNonce();
$this->saveStorage();
// Reset pending backups
AECoreKettenrad::reset(array(
'maxrun' => 0
));
// Redirect
$app = JFactory::getApplication();
$app->redirect('index.php');
return;
}
// Hijack the application to do the backup steps if aklazy and nonce
// params are defined in the URL query
$aklazy = JRequest::getCmd('aklazy',null);
$nonce = JRequest::getCmd('nonce',null);
// Can we create test files in the storage directory?
$filename = $this->getStorageFilename().'.tmp';
jimport('joomla.filesystem.file');
// Fix 3.2.2: JFile::write in 1.6 uses pass-by-reference for the data part
$dummyData = 'x';
$touched = @file_put_contents($filename, $dummyData);
if(!$touched) {
$touched = JFile::write($filename,$dummyData);
}
if($touched) {
if(!@unlink($filename)) {
JFile::delete($filename);
}
} else {
$app = JFactory::getApplication();
if(JFactory::getApplication()->isAdmin()) {
JError::raiseWarning(0, "Your cache directory (".JPATH_SITE.DS."cache) is not writable. Akeeba Backup Lazy Scheduling plugin will not work until you fix this issue.");
}
return;
}
// Load the settings
$status = $this->loadStorage();
if(!$status) {
$app = JFactory::getApplication();
if(JFactory::getApplication()->isAdmin()) {
JError::raiseWarning(0, "Akeeba Backup Lazy Scheduling plugin can not read its temporary file. Make sure the cache directory in your site's root is writable and readable.");
}
return;
}
// When aklazy is 'check', it returns a backup URL, or dies if there's
// no need to start/step a backup.
if( ($aklazy == 'check') )
{
// Do a backup necessity check and return a URL or nothing at all
$state = $this->getBackupState();
if($state != 'none')
{
$url = JURI::base().'index.php?aklazy='.$state.'&nonce='.$this->nonce;
}
else
{
$url = '';
}
//.........这里部分代码省略.........