SS 4.0 - Upgrade Combinations array and Logging

This commit is contained in:
Brett Tasker 2017-04-26 23:24:51 +12:00
parent 6fb5736ef3
commit fa7a23a6d2
4 changed files with 15 additions and 2 deletions

View File

@ -1,6 +1,9 @@
<?php <?php
namespace SilverStripe\FullTextSearch\Utils; namespace SilverStripe\FullTextSearch\Utils;
use Iterator; use Iterator;
class CombinationsArrayIterator implements Iterator class CombinationsArrayIterator implements Iterator
{ {
protected $arrays; protected $arrays;

View File

@ -1,9 +1,13 @@
<?php <?php
namespace SilverStripe\FullTextSearch\Utils\Logging; namespace SilverStripe\FullTextSearch\Utils\Logging;
use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\FormatterInterface;
use Monolog\Formatter\LineFormatter; use Monolog\Formatter\LineFormatter;
use Monolog\Handler\HandlerInterface; use Monolog\Handler\HandlerInterface;
use Monolog\Logger; use Monolog\Logger;
use SilverStripe\Control\Director;
use SilverStripe\Core\Injector\Injector;
/** /**
* Provides logging based on monolog * Provides logging based on monolog
@ -97,7 +101,7 @@ class MonologFactory implements SearchLogFactory
protected function getJobHandler($job) protected function getJobHandler($job)
{ {
return Injector::inst()->createWithArgs( return Injector::inst()->createWithArgs(
'QueuedJobLogHandler', 'SilverStripe\FullTextSearch\Utils\Logging\QueuedJobLogHandler',
array($job, Logger::INFO) array($job, Logger::INFO)
); );
} }

View File

@ -1,12 +1,16 @@
<?php <?php
namespace SilverStripe\FullTextSearch\Utils\Logging; namespace SilverStripe\FullTextSearch\Utils\Logging;
use Monolog\Handler\AbstractProcessingHandler; use Monolog\Handler\AbstractProcessingHandler;
use Monolog\Logger; use Monolog\Logger;
if (!interface_exists('QueuedJob')) { if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) {
return; return;
} }
use SilverStripe\QueuedJobs\Services\QueuedJob;
/** /**
* Handler for logging events into QueuedJob message data * Handler for logging events into QueuedJob message data
*/ */

View File

@ -1,5 +1,7 @@
<?php <?php
namespace SilverStripe\FullTextSearch\Utils\Logging; namespace SilverStripe\FullTextSearch\Utils\Logging;
use Psr\Log; use Psr\Log;
interface SearchLogFactory interface SearchLogFactory