Skip to content

Commit

Permalink
#11 - fixing broken unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alphadevx committed Sep 17, 2015
1 parent 8bbb96c commit c9b1da6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Alpha/Controller/FeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Alpha\Controller;

use Alpha\Util\Logging\Logger;
use Alpha\Util\Logging\LogFile;
use Alpha\Util\Logging\LogProviderFile;
use Alpha\Util\Feed\RSS2;
use Alpha\Util\Feed\RSS;
use Alpha\Util\Feed\Atom;
Expand Down Expand Up @@ -209,7 +209,7 @@ public function doGET($request)
$response->setBody($feed->render());

// log the request for this news feed
$feedLog = new LogFile($config->get('app.file.store.dir').'logs/feeds.log');
$feedLog = new LogProviderFile($config->get('app.file.store.dir').'logs/feeds.log');
$feedLog->writeLine(array($this->ActiveRecordType, $this->type, date('Y-m-d H:i:s'), $request->getUserAgent(), $request->getIP()));
} catch (IllegalArguementException $e) {
self::$logger->error($e->getMessage());
Expand Down
4 changes: 2 additions & 2 deletions Alpha/Controller/LogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Alpha\Controller;

use Alpha\Util\Logging\Logger;
use Alpha\Util\Logging\LogFile;
use Alpha\Util\Logging\LogProviderFile;
use Alpha\Util\Http\Request;
use Alpha\Util\Http\Response;
use Alpha\Exception\IllegalArguementException;
Expand Down Expand Up @@ -120,7 +120,7 @@ public function doGET($request)

$body .= View::displayPageHead($this);

$log = new LogFile($this->logPath);
$log = new LogProviderFile($this->logPath);
if (preg_match('/alpha.*/', basename($this->logPath))) {
$body .= $log->renderLog(array('Date/time', 'Level', 'Class', 'Message', 'Client', 'IP', 'Server hostname'));
}
Expand Down
4 changes: 2 additions & 2 deletions Alpha/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Alpha\Util\Logging\Logger;
use Alpha\Util\Logging\KPI;
use Alpha\Util\Logging\LogFile;
use Alpha\Util\Logging\LogProviderFile;
use Alpha\Util\Config\ConfigProvider;
use Alpha\Util\Http\Request;
use Alpha\Util\Http\Response;
Expand Down Expand Up @@ -148,7 +148,7 @@ public function doGET($request)
$body .= View::displayPageHead($this);

// log the user's search query in a log file
$log = new LogFile($config->get('app.file.store.dir').'logs/search.log');
$log = new LogProviderFile($config->get('app.file.store.dir').'logs/search.log');
$log->writeLine(array($params['query'], date('Y-m-d H:i:s'), $request->getUserAgent(), $request->getIP()));

$KPI->logStep('log search query');
Expand Down
2 changes: 1 addition & 1 deletion Alpha/Task/BackupTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function doTask()
$config = ConfigProvider::getInstance();

self::$logger = new Logger('BackupTask');
self::$logger->setLogFile($config->get('app.file.store.dir').'logs/tasks.log');
self::$logger->setLogProviderFile($config->get('app.file.store.dir').'logs/tasks.log');

if (!file_exists($config->get('backup.dir'))) {
mkdir($config->get('backup.dir'));
Expand Down
2 changes: 1 addition & 1 deletion Alpha/Task/CronManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function __construct()
$config = ConfigProvider::getInstance();

self::$logger = new Logger('CronManager');
self::$logger->setLogFile($config->get('app.file.store.dir').'logs/tasks.log');
self::$logger->setLogProviderFile($config->get('app.file.store.dir').'logs/tasks.log');

self::$logger->debug('>>__construct()');

Expand Down
4 changes: 2 additions & 2 deletions Alpha/Util/Logging/KPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function log()

$this->duration = $this->endTime - $this->startTime;

$logfile = new LogFile($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv');
$logfile = new LogProviderFile($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv');

$logfile->setMaxSize($config->get('app.log.file.max.size'));

Expand All @@ -190,7 +190,7 @@ public function logStep($stepName)

$this->duration = $this->endTime - $this->startTime;

$logfile = new LogFile($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv');
$logfile = new LogProviderFile($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv');

$logfile->setMaxSize($config->get('app.log.file.max.size'));

Expand Down

0 comments on commit c9b1da6

Please sign in to comment.