src/EventRunner.php
protected function start(Event $event): void
    {
        // if sendOutputTo or appendOutputTo have been specified
        if (!$event->nullOutput()) {
            // if sendOutputTo then truncate the log file if it exists
            if (!$event->shouldAppendOutput) {
                $f = @\fopen($event->output, 'r+');
                if (false !== $f) {
                    \ftruncate($f, 0);
                    \fclose($f);
                }
            }
            // Create an instance of the Logger specific to the event
            $event->logger = $this->loggerFactory->create(
                [
                    // Logging streams
                    'info' => $event->output,
                ]
            );
        }

        $this->consoleLogger
            ->debug("Invoke Event's ping before.");

        $this->pingBefore($event);

        // Running the before-callbacks
        $event->outputStream = ($this->invoke($event->beforeCallbacks()));
        $event->start();
    }
protected function start(Event $event): void
    {
        // if sendOutputTo or appendOutputTo have been specified
        if (!$event->nullOutput()) {
            // if sendOutputTo then truncate the log file if it exists
            if (!$event->shouldAppendOutput) {
                $f = @\fopen($event->output, 'r+');
                if (false !== $f) {
                    \ftruncate($f, 0);
                    \fclose($f);
                }
            }
            // Create an instance of the Logger specific to the event
            $event->logger = $this->loggerFactory->create(
                [
                    // Logging streams
                    'info' => $event->output,
                ]
            );
        }

        $this->consoleLogger
            ->debug("Invoke Event's ping before.");

        $this->pingBefore($event);

        // Running the before-callbacks
        $event->outputStream = ($this->invoke($event->beforeCallbacks()));
        $event->start();
    }
protected function start ( Event $ event ) : void { // if sendOutputTo or appendOutputTo have been specified if ( ! $ event -> nullOutput ( ) ) { // if sendOutputTo then truncate the log file if it exists if ( ! $ event -> shouldAppendOutput ) { $ f = @ \ fopen ( $ event -> output , 'r+' ) ; if ( false !== $ f ) { \ ftruncate ( $ f , 0 ) ; \ fclose ( $ f ) ; } } // Create an instance of the Logger specific to the event $ event -> logger = $ this -> loggerFactory -> create ( [ // Logging streams 'info' => $ event -> output , ] ) ; } $ this -> consoleLogger -> debug ( "Invoke Event's ping before." ) ; $ this -> pingBefore ( $ event ) ; // Running the before-callbacks $ event -> outputStream = ( $ this -> invoke ( $ event -> beforeCallbacks ( ) ) ) ; $ event -> start ( ) ; }
Run an event process.


@param \Crunz\Event $event
Run an event process .