Scalr\System\Zmq\Cron\AbstractTask::__construct PHP Method

__construct() public method

Constructor
public __construct ( )
    public function __construct()
    {
        $basename = preg_replace('/^.+\\\\(\\w+)$/', '$1', get_class($this));
        $this->name = \Scalr::decamelize($basename);
        $this->pids = [];
        $this->toDisconnect = [];
        $this->setLogger(\Scalr::getContainer()->logger($this->name)->setLevel($this->config()->log_level));
        //It is possible to redefine default payload class for the task
        if (file_exists(__DIR__ . '/Payload/' . $basename . 'Payload.php')) {
            $this->payloadClass = __NAMESPACE__ . '\\Payload\\' . $basename . 'Payload';
        }
        $container = \Scalr::getContainer();
        $container->set('auditlogger.request', function () {
            return $this;
        });
    }

Usage Example

Esempio n. 1
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->db = \Scalr::getDb();
 }
All Usage Examples Of Scalr\System\Zmq\Cron\AbstractTask::__construct