// Update new installer

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11561 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-12-21 21:33:22 +00:00
parent 8ab8ef1fec
commit 25811cee65
253 changed files with 14861 additions and 14216 deletions
+44
View File
@@ -50,3 +50,47 @@ require_once _PS_INSTALL_PATH_.'classes/model.php';
require_once _PS_INSTALL_PATH_.'classes/session.php';
require_once _PS_INSTALL_PATH_.'classes/sqlLoader.php';
require_once _PS_INSTALL_PATH_.'classes/xmlLoader.php';
class InstallLog
{
/**
* @return InstallLog
*/
public function getInstance()
{
static $instance = null;
if (!$instance)
$instance = new InstallLog();
return $instance;
}
protected $fd;
protected $start_time = array();
protected $last_time;
public function __construct()
{
$this->fd = fopen(_PS_INSTALL_PATH_.'log.txt', 'w');
$this->last_time = microtime(true);
}
public function write($id)
{
$str = "[$id]";
$str .= ' - [Time: '.round(microtime(true) - $this->last_time, 4).']';
if (isset($this->start_time[$id]))
$str .= ' - [Length: '.round(microtime(true) - $this->start_time[$id], 4).']';
fwrite($this->fd, "$str\n");
}
public function start($id)
{
$this->start_time[$id] = microtime(true);
}
public function __destruct()
{
fclose($this->fd);
}
}