Function that's called when MocaBonita is started.

@return void
164902
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();
    }
340720
public function init()
    {
        craft()->on('assets.onSaveAsset', function (Event $event) {
            $this->copyAsset($event->params['asset']);
        });

        craft()->on('assets.onReplaceFile', function (Event $event) {
            $this->copyAsset($event->params['asset']);
        });

        craft()->on('assets.onBeforeDeleteAsset', function (Event $event) {
            $this->deleteAsset($event->params['asset']);
        });
    }
595900
public function beginTransaction()
    {
        if ( $this->link == null ) {
            $this->connect();
        }
        ++$this->transactions;

        if ( $this->transactions == 1 ) {
            $this->link->beginTransaction();
        }


    }
578666
public function onInit()
    {
        $this->nameSort = Utility::get($this->params, '{name}', null);
        $this->labelSort = Utility::get($this->params, '{label}', null);
        $this->fixedColumns = Utility::get($this->params, 'fixedColumns', null);
    }
705954
protected function initShutdownFunction()
    {
        if (!$this->registeredShutdown) {
            $this->registerShutdownFunction([$this, 'shutdownFunction']) ?: false;
            $this->registeredShutdown = true;
            
            $this->reserveMemory();
        }
    }
1162186
public function start()
	{
		if(!self::$isStarted){
			$this->session();
			$this->setDefaultTimezone();
			$this->registerErrorhandler();
			self::$isStarted = true;
		}
	}
781594
public function onInit()
    {
        $func = Util::get($this->params, '{init}', null);
        if (is_callable($func)) {
            $this->mapState = $func($data);
        }
    }
102958
public function doBefore() {
        $this->_isMobile = $this->_md->isMobile();
        $this->_isTablet = $this->_md->isTablet();

        if(!isset($_SESSION[$this->_sessionAutoName]) && $this->_isTablet){
            $_SESSION[$this->_sessionAutoName] = $this->_allowMobileForTablet;
        }
        elseif(!isset($_SESSION[$this->_sessionAutoName]) || $_SESSION[$this->_sessionAutoName] == '') {
            $_SESSION[$this->_sessionAutoName] = $this->_defaultBehaviour;
        }

        $_SESSION[$this->_sessionName] = $this->_isMobile;
    }
969477
public function beginTransaction()
    {
        ++$this->transactions;

        if ($this->transactions == 1) {
            $this->pdo->beginTransaction();
        }

        $this->fireConnectionEvent('beganTransaction');
    }
245292
public function start()
    {
        if ($this->started === false) {
            $this->sessionIdentifier = Algorithms::generateRandomString(32);
            $this->storageIdentifier = Algorithms::generateUUID();
            $this->sessionCookie = new Cookie($this->sessionCookieName, $this->sessionIdentifier, 0, $this->sessionCookieLifetime, $this->sessionCookieDomain, $this->sessionCookiePath, $this->sessionCookieSecure, $this->sessionCookieHttpOnly);
            $this->lastActivityTimestamp = $this->now;
            $this->started = true;

            $this->writeSessionMetaDataCacheEntry();
        }
    }
856645
public function init(): void
    {
        parent::init();

        $this->_currentTable = $this->tableName;

        foreach ($this->skipMigrations as $index => $migration) {
            $this->skipMigrations[$index] = trim($migration, '\\');
        }
    }
432798
public function init()
    {
        if ($this->autoStart && !$this->isStarted()) {
            $this->start();

            $this->autoStart = false;
        }
    }
905771
public function startWpDispatcher(MbRequest $mbRequest, MbResponse $mbResponse, MocaBonita $mocaBonita)
    {
        $className = static::class;
        $methodName = __METHOD__;
        throw new MbException("{$methodName} not allowed in! {$className}.");
    }
1055842
public function startTrans() {
        $this->connect();
        $this->transTimes++;
        if (1 == $this->transTimes) {
            $this->pdo->beginTransaction();
        }
    }
1113690
public function onWakeup()
    {
        $this->running = true;
        Daemon::$context = $this;
        $_SESSION = &$this->attrs->session;
        $_GET = &$this->attrs->get;
        $_POST = [];
        $_COOKIE = &$this->attrs->cookie;
        Daemon::$process->setState(Daemon::WSTATE_BUSY);
    }
641802
protected function initialize()
    {
        if ($this->state->isInitialized()) {
            return;
        }

        if ($this->modeCAS) {
            $this->state->flag(MultiExecState::CAS);
        }

        if ($this->watchKeys) {
            $this->watch($this->watchKeys);
        }

        $cas = $this->state->isCAS();
        $discarded = $this->state->isDiscarded();

        if (!$cas || ($cas && $discarded)) {
            $this->call('MULTI');

            if ($discarded) {
                $this->state->unflag(MultiExecState::CAS);
            }
        }

        $this->state->unflag(MultiExecState::DISCARDED);
        $this->state->flag(MultiExecState::INITIALIZED);
    }
776483
function start(): void {
        if($this->nativeHrtime) {
            $this->timer = \hrtime(true);
        } elseif($this->hrtime) {
            $this->timer->start();
        } else {
            $this->timer = \microtime(true);
        }
    }