1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Prevent empty log files.

This commit is contained in:
Cameron 2013-05-15 16:07:10 -07:00
parent e9173717a7
commit f07b1a70ab
4 changed files with 23 additions and 7 deletions

View File

@ -653,6 +653,10 @@ class e_admin_log
{
$text .= " e107 CMS Log file : ".$logTitle." ".date('Y-m-d_H-i-s')."\n";
$text .= "-------------------------------------------------------------------------------------------\n\n";
}
else
{
return;
}
foreach($this->_allMessages as $m)
@ -660,8 +664,10 @@ class e_admin_log
$text .= date('Y-m-d H:i:s',$m['time'])." \t".str_pad($m['dislevel'],10," ",STR_PAD_RIGHT)."\t".strip_tags($m['message'])."\n";
}
$date = date('Y-m-d_H-i-s');
$fileName = e_LOG.$date."_".$this->logFile.".log";
if(file_put_contents($this->logFile,$text))
if(file_put_contents($fileName,$text))
{
$this->_allMessages = array();
return $this->logFile;
@ -681,9 +687,9 @@ class e_admin_log
public function toFile($name,$logTitle='')
{
$date = date('Y-m-d_H-i-s');
$this->logFile = e_LOG.$date."_".$name.".log";
$this->logFile = $name;
$this->saveToFile($logTitle);
$this->logFile = null;
}

View File

@ -11,7 +11,7 @@
if (!defined('e107_INIT')) { exit; }
/**
* DEPRECATED: Allows Storage of arrays without use of serialize functions
* @DEPRECATED: Allows Storage of arrays without use of serialize functions
*
*/
class ArrayData {

View File

@ -367,7 +367,7 @@ class e_array {
/**
* DEPRECATED - Backwards Compatible. Use write() instead;
* @DEPRECATED - Backwards Compatible. Use e107::serialize() instead;
* @param array $ArrayData array to be stored
* @param bool $AddSlashes default true, add slashes for db storage, else false
* @returnReturn a string containg exported array data.
@ -385,7 +385,7 @@ class e_array {
}
/**
* DEPRECATED: Use read(); instead.
* @DEPRECATED: Use e107::unserialize(); instead.
* Returns an array from stored array data.
*
* @param string $ArrayData

View File

@ -173,6 +173,7 @@ class e107plugin
$xml = e107::getXml();
$mes = e107::getMessage();
$needed = array();
$log = e107::getAdminLog();
if(!$plugVersions = e107::getConfig('core')->get('plug_installed'))
{
@ -195,6 +196,7 @@ class e107plugin
$mes->addDebug("Plugin Update(s) Required");
return TRUE;
}
$needed[$path] = $data;
}
@ -207,11 +209,19 @@ class e107plugin
return TRUE;
}
$mes->addDebug("Plugin: <strong>{$path}</strong> requires an update.");
// $mes->addDebug("Plugin: <strong>{$path}</strong> requires an update.");
// $log->flushMessages();
$needed[$path] = $data;
}
}
}
// Display debug and log to file.
foreach($needed as $path=>$tmp)
{
$log->addDebug("Plugin: <strong>{$path}</strong> requires an update.");
}
return count($needed) ? $needed : FALSE;