src/Control/Controller.php
public function doInit()
    {
        //extension hook
        $this->extend('onBeforeInit');

        // Safety call
        $this->baseInitCalled = false;
        $this->init();
        if (!$this->baseInitCalled) {
            $class = static::class;
            user_error(
                "init() method on class '{$class}' doesn't call Controller::init()."
                . "Make sure that you have parent::init() included.",
                E_USER_WARNING
            );
        }

        $this->extend('onAfterInit');
    }
public function doInit()
    {
        //extension hook
        $this->extend('onBeforeInit');

        // Safety call
        $this->baseInitCalled = false;
        $this->init();
        if (!$this->baseInitCalled) {
            $class = static::class;
            user_error(
                "init() method on class '{$class}' doesn't call Controller::init()."
                . "Make sure that you have parent::init() included.",
                E_USER_WARNING
            );
        }

        $this->extend('onAfterInit');
    }
public function doInit ( ) { //extension hook $ this -> extend ( 'onBeforeInit' ) ; // Safety call $ this -> baseInitCalled = false ; $ this -> init ( ) ; if ( ! $ this -> baseInitCalled ) { $ class = static :: class ; user_error ( "init() method on class '{$class}' doesn't call Controller::init()." . "Make sure that you have parent::init() included." , E_USER_WARNING ) ; } $ this -> extend ( 'onAfterInit' ) ; }
A stand in function to protect the init function from failing to be called as well as providing before and
after hooks for the init function itself

This should be called on all controllers before handling requests
A stand in function to protect the init function from failing to be called as well as providing before and after hooks for the init function itself