本文整理汇总了PHP中AEUtilLogger::logName方法的典型用法代码示例。如果您正苦于以下问题:PHP AEUtilLogger::logName方法的具体用法?PHP AEUtilLogger::logName怎么用?PHP AEUtilLogger::logName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AEUtilLogger
的用法示例。
在下文中一共展示了AEUtilLogger::logName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: download
public function download()
{
AEPlatform::getInstance()->load_configuration(AEPlatform::getInstance()->get_active_profile());
$tag = JRequest::getCmd('tag', null);
$filename = AEUtilLogger::logName($tag);
@ob_end_clean();
// In case some braindead plugin spits its own HTML
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Date in the past
header("Content-Description: File Transfer");
header('Content-Type: text/plain');
header('Content-Disposition: attachment; filename="Akeeba Backup Debug Log.txt"');
echo "WARNING: Do not copy and paste lines from this file!\r\n";
echo "You are supposed to ZIP and attach it in your support forum post.\r\n";
echo "If you fail to do so, your support request will receive minimal priority.\r\n";
echo "\r\n";
echo "--- START OF RAW LOG --\r\n";
@readfile($filename);
// The at sign is necessary to skip showing PHP errors if the file doesn't exist or isn't readable for some reason
echo "--- END OF RAW LOG ---\r\n";
flush();
JFactory::getApplication()->close();
}
示例2: echoRawLog
public function echoRawLog()
{
$tag = $this->getState('tag', '');
echo "WARNING: Do not copy and paste lines from this file!\r\n";
echo "You are supposed to ZIP and attach it in your support forum post.\r\n";
echo "If you fail to do so, your support request will receive minimal priority.\r\n";
echo "\r\n";
echo "--- START OF RAW LOG --\r\n";
@readfile(AEUtilLogger::logName($tag));
// The at sign is necessary to skip showing PHP errors if the file doesn't exist or isn't readable for some reason
echo "--- END OF RAW LOG ---\r\n";
}
示例3: runAnalysis
public function runAnalysis()
{
$ret_array = array();
$ajaxTask = $this->getState('ajax');
$log = $this->getState('log');
switch ($ajaxTask) {
case 'start':
$tag = 'alice';
AliceUtilLogger::WriteLog(true);
AliceUtilLogger::WriteLog(_AE_LOG_INFO, 'Starting analysis');
AliceCoreKettenrad::reset(array('maxrun' => 0));
AliceUtilTempvars::reset($tag);
$kettenrad = AliceCoreKettenrad::load($tag);
$options = array('logToAnalyze' => AEUtilLogger::logName($log));
$kettenrad->setup($options);
$kettenrad->tick();
if ($kettenrad->getState() != 'running') {
$kettenrad->tick();
}
$ret_array = $kettenrad->getStatusArray();
$kettenrad->resetWarnings();
// So as not to have duplicate warnings reports
AliceCoreKettenrad::save($tag);
break;
case 'step':
$tag = 'alice';
$kettenrad = AliceCoreKettenrad::load($tag);
$kettenrad->tick();
$ret_array = $kettenrad->getStatusArray();
$kettenrad->resetWarnings();
// So as not to have duplicate warnings reports
AliceCoreKettenrad::save($tag);
if ($ret_array['HasRun'] == 1) {
// Let's get tests result
$config = AliceFactory::getConfiguration();
$feedback = $config->get('volatile.alice.feedback');
$ret_array['Results'] = json_encode($feedback);
// Clean up
AliceFactory::nuke();
AliceUtilTempvars::reset($tag);
}
break;
default:
break;
}
return $ret_array;
}
示例4: openLog
public static function openLog($tag = null)
{
AEUtilLogger::$logName = AEUtilLogger::logName($tag);
@touch(AEUtilLogger::$logName);
}
示例5: reset
/**
* Resets the Kettenrad state, wipping out any pending backups and/or stale
* temporary data.
*
* @param array $config Configuration parameters for the reset operation
*/
public static function reset($config = array())
{
$default_config = array('global' => true, 'log' => false, 'maxrun' => 0);
$config = (object) array_merge($default_config, $config);
// Pause logging if so desired
if (!$config->log) {
AEUtilLogger::WriteLog(false, '');
}
$tag = null;
if (!$config->global) {
// If we're not resetting globally, get a list of running backups per tag
$tag = AEPlatform::getInstance()->get_backup_origin();
}
// Cache the factory before proceeding
$factory = AEFactory::serialize();
$runningList = AEPlatform::getInstance()->get_running_backups($tag);
// Origins we have to clean
$origins = array(AEPlatform::getInstance()->get_backup_origin());
// 1. Detect failed backups
if (is_array($runningList) && !empty($runningList)) {
// The current timestamp
$now = time();
// Mark running backups as failed
foreach ($runningList as $running) {
if (empty($tag)) {
// Check the timestamp of the log file to decide if it's stuck,
// but only if a tag is not set
$tstamp = @filemtime(AEUtilLogger::logName($running['origin']));
if ($tstamp !== false) {
// We can only check the timestamp if it's returned. If not, we assume the backup is stale
$difference = abs($now - $tstamp);
// Backups less than 3 minutes old are not considered stale
if ($difference < $config->maxrun) {
continue;
}
}
}
$filenames = AEUtilStatistics::get_all_filenames($running, false);
// Process if there are files to delete...
if (!is_null($filenames)) {
// Delete the failed backup's archive, if exists
foreach ($filenames as $failedArchive) {
AEPlatform::getInstance()->unlink($failedArchive);
}
}
// Mark the backup failed
$running['status'] = 'fail';
$running['multipart'] = 0;
$dummy = null;
AEPlatform::getInstance()->set_or_update_statistics($running['id'], $running, $dummy);
$origins[] = $running['origin'];
}
}
if (!empty($origins)) {
$origins = array_unique($origins);
foreach ($origins as $tag) {
AECoreKettenrad::load($tag);
// Remove temporary files
AEUtilTempfiles::deleteTempFiles();
// Delete any stale temporary data
AEUtilTempvars::reset($tag);
}
}
// Reload the factory
AEFactory::unserialize($factory);
unset($factory);
// Unpause logging if it was previously paused
if (!$config->log) {
AEUtilLogger::WriteLog(true, '');
}
}
示例6: onKeyDown
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
// Disable CTRL-C, CTRL-V
function onKeyDown() {
return false;
}
document.onkeydown = onKeyDown;
</script>
<?php
// -- Get the log's file name
$tag = JRequest::getCmd('tag', 'null');
$logName = AEUtilLogger::logName($tag);
// Load JFile class
jimport('joomla.filesystem.file');
@ob_end_clean();
if (!JFile::exists($logName)) {
// Oops! The log doesn't exist!
echo '<p>' . JText::_('LOG_ERROR_LOGFILENOTEXISTS') . '</p>';
return;
} else {
// Allright, let's load and render it
$fp = fopen($logName, "rt");
if ($fp === FALSE) {
// Oops! The log isn't readable?!
echo '<p>' . JText::_('LOG_ERROR_UNREADABLE') . '</p>';
return;
}
示例7: _apiGetLog
private function _apiGetLog($config)
{
$defConfig = array('tag' => 'remote');
$config = array_merge($defConfig, $config);
extract($config);
$filename = AEUtilLogger::logName($tag);
$buffer = file_get_contents($filename);
switch ($this->encapsulation) {
case self::ENCAPSULATION_RAW:
return base64_encode($buffer);
break;
case self::ENCAPSULATION_AESCTR128:
$this->encapsulation = self::ENCAPSULATION_AESCBC128;
return $buffer;
break;
case self::ENCAPSULATION_AESCTR256:
$this->encapsulation = self::ENCAPSULATION_AESCBC256;
return $buffer;
break;
default:
// On encrypted comms the encryption will take care of transport encoding
return $buffer;
break;
}
}
示例8: __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 = '';
}
//.........这里部分代码省略.........