Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 722 Bytes

README.md

File metadata and controls

35 lines (26 loc) · 722 Bytes

Phalcon clockwork

#Installation Install the Clockwork library via Composer.

$ composer require kolesa-team/phalcon-clockwork

Set events manager to service(di)

        $di->set('eventsManager', function () {
            $manager = new Phalcon\Events\Manager();

            return $manager;
        }, true);

Set events manager to Application

    $eventsManager = $di->get('eventsManager');
    $application   = new Phalcon\Mvc\Application($di);
    
    $application->setEventsManager($eventsManager)

Init clockwork

    $clockwork = new ClockworkServices();
    
    $clockwork->setEventsManager($di->get('eventsManager'));      
    $clockwork->initialize();