src/MocaBonita.php
protected function init()
    {
        if (!defined('ABSPATH')) {
            die('MocaBonita must be loaded along with Wordpress!' . PHP_EOL);
        }

        $timezone = get_option('timezone_string');

        if (!empty($timezone)) {
            date_default_timezone_set($timezone);
        }

        $mbAudit = new MbAudit();
        $mbRequest = MbRequest::capture();
        $mbResponse = MbResponse::create();

        $mbRequest->ajax();

        $mbRequest->setBlogAdmin(is_blog_admin());

        $mbAudit->setRequest($mbRequest);
        $mbResponse->setMbRequest($mbRequest);
        $mbResponse->setMbAudit($mbAudit);

        $this->setPage($mbRequest->query('page'));
        $this->setAction($mbRequest->query('action', 'index'));

        $this->setMbRequest($mbRequest);
        $this->setMbResponse($mbResponse);
        $this->setMbAudit($mbAudit);

        $this->mbAssets = new Collection([
            'plugin'    => new MbAsset(),
            'wordpress' => new MbAsset(),
        ]);

        $this->mbEvents = new Collection();
        $this->mbShortCodes = new Collection();
        $this->mbPages = new Collection();

        MbMigration::enableWpdbConnection();
    }
protected function init()
    {
        if (!defined('ABSPATH')) {
            die('MocaBonita must be loaded along with Wordpress!' . PHP_EOL);
        }

        $timezone = get_option('timezone_string');

        if (!empty($timezone)) {
            date_default_timezone_set($timezone);
        }

        $mbAudit = new MbAudit();
        $mbRequest = MbRequest::capture();
        $mbResponse = MbResponse::create();

        $mbRequest->ajax();

        $mbRequest->setBlogAdmin(is_blog_admin());

        $mbAudit->setRequest($mbRequest);
        $mbResponse->setMbRequest($mbRequest);
        $mbResponse->setMbAudit($mbAudit);

        $this->setPage($mbRequest->query('page'));
        $this->setAction($mbRequest->query('action', 'index'));

        $this->setMbRequest($mbRequest);
        $this->setMbResponse($mbResponse);
        $this->setMbAudit($mbAudit);

        $this->mbAssets = new Collection([
            'plugin'    => new MbAsset(),
            'wordpress' => new MbAsset(),
        ]);

        $this->mbEvents = new Collection();
        $this->mbShortCodes = new Collection();
        $this->mbPages = new Collection();

        MbMigration::enableWpdbConnection();
    }
protected function init ( ) { if ( ! defined ( 'ABSPATH' ) ) { die ( 'MocaBonita must be loaded along with Wordpress!' . PHP_EOL ) ; } $ timezone = get_option ( 'timezone_string' ) ; if ( ! empty ( $ timezone ) ) { date_default_timezone_set ( $ timezone ) ; } $ mbAudit = new MbAudit ( ) ; $ mbRequest = MbRequest :: capture ( ) ; $ mbResponse = MbResponse :: create ( ) ; $ mbRequest -> ajax ( ) ; $ mbRequest -> setBlogAdmin ( is_blog_admin ( ) ) ; $ mbAudit -> setRequest ( $ mbRequest ) ; $ mbResponse -> setMbRequest ( $ mbRequest ) ; $ mbResponse -> setMbAudit ( $ mbAudit ) ; $ this -> setPage ( $ mbRequest -> query ( 'page' ) ) ; $ this -> setAction ( $ mbRequest -> query ( 'action' , 'index' ) ) ; $ this -> setMbRequest ( $ mbRequest ) ; $ this -> setMbResponse ( $ mbResponse ) ; $ this -> setMbAudit ( $ mbAudit ) ; $ this -> mbAssets = new Collection ( [ 'plugin' => new MbAsset ( ) , 'wordpress' => new MbAsset ( ) , ] ) ; $ this -> mbEvents = new Collection ( ) ; $ this -> mbShortCodes = new Collection ( ) ; $ this -> mbPages = new Collection ( ) ; MbMigration :: enableWpdbConnection ( ) ; }
Function that's called when MocaBonita is started.

@return void
Function that s called when MocaBonita is started .