{@inheritdoc}

@see \Concrete\Core\Controller\AbstractController::on_start()
774815
public function on_start()
    {
        parent::on_start();

        $this->view = new View('/frontend/upgrade');
        $this->setTheme('concrete');

        $this->siteVersion = $this->app->make('config')->get('concrete.version_installed');
        $this->checkSecurity();
        Cache::disableAll();
    }
9795
public function onSessionStartEvent()
    {
        return function ($sessionStartEvent) {
            /** @var \PHPDaemon\Core\DeferredEvent $sessionStartEvent */
            $name = ini_get('session.name');
            $sid = $this->getCookieStr($name);
            if ($sid === '') {
                $this->sessionStartNew(function ($success) use ($sessionStartEvent) {
                    $sessionStartEvent->setResult($success);
                });
                return;
            }
            $this->onSessionRead(function ($session) use ($sessionStartEvent) {
                if ($this->getSessionState() === null) {
                    $this->sessionStartNew(function ($success) use ($sessionStartEvent) {
                        $sessionStartEvent->setResult($success);
                    });
                    return;
                }
                $sessionStartEvent->setResult(true);
            });
        };
    }
568123
private function beforeAfterController(string $when): void
    {
        if (\method_exists($this->controller, $when)) {
            \call_user_func([$this->controller, $when]);
        }
    }
57592
public function onBeforeInit()
    {
        $disallowed_controllers = [
            DevelopmentAdmin::class,
            DevBuildController::class,
            DatabaseAdmin::class
        ];

        // Don't run this during dev/build or dev/tasks
        if (!in_array(get_class($this->owner), $disallowed_controllers)) {
            // Set global local based on Site Config
            $config = SiteConfig::current_site_config();
            i18n::set_locale($config->SiteLocale);

            // Now find and set the desired currency symbol
            $number_format = new NumberFormatter($config->SiteLocale, NumberFormatter::CURRENCY);
            $symbol = $number_format->getSymbol(NumberFormatter::CURRENCY_SYMBOL);
            DBCurrency::config()->currency_symbol = $symbol;
        }
    }
855915
public function start()
    {
        foreach ($this->items as $run) {
            if (!$run->hasStarted()) {
                $run->start();
            }
        }
        return $this;
    }
83915
public function onReady()
    {
        if ($this->config->enable->value) {
            $this->timer = setTimeout(function ($timer) {
                $this->touchCursor();
            }, 0.3e6);
        }
    }
1254325
public function onReady()
    {
        $this->ptr =& $this->result;
        if (!isset($this->password)) {
            if (isset($this->pool->config->select->value)) {
                $this->select($this->pool->config->select->value);
            }
            parent::onReady();
            $this->setWatermark(null, $this->pool->maxAllowedPacket + 2);
            return;
        }
        $this->sendCommand('AUTH', [$this->password], function () {
            if ($this->result !== 'OK') {
                $this->log('Auth. error: ' . json_encode($this->result));
                $this->finish();
            }
            if (isset($this->pool->config->select->value)) {
                $this->select($this->pool->config->select->value);
            }
            parent::onReady();
            $this->setWatermark(null, $this->pool->maxAllowedPacket + 2);
        });
    }
755112
protected function onInit()
    {
        parent::onInit();
        $this->type = "PieChart";
        if (!isset($this->options["pieHole"])) {
            $this->options["pieHole"] = 0.4;
        }
    }
535619
protected function beforeStart()
    {
        // If no explicit request was given (via Enlighten::setRequest), create one based on the current PHP globals
        if (empty($this->request)) {
            $this->setRequest(Request::extractFromEnvironment());
        }

        $this->bootstrapRouter();
    }
1119601
protected function onInit()
    {
        $host = Util::get($this->params, "host", "");//host\instanceName
        $username = Util::get($this->params, "username", "");
        $password = Util::get($this->params, "password", "");
        $dbname = Util::get($this->params, "dbname", "");
        $connString = "host=$host dbname=$dbname user=$username password=$password";
        
        $key = md5($connString);

        if (isset(PostgreSQLDataSource::$connections[$key])) {
            $this->connection = PostgreSQLDataSource::$connections[$key];
        } else {
            $conn = pg_connect($connString);
            if ($conn) {
                $this->connection = $conn;
            } else {
                throw new \Exception("Could not connect to database");
            }
            PostgreSQLDataSource::$connections[$key] = $this->connection;
        }
        
    }
165591
protected function startup()
    {
        $this->getProcess()->setTitle('Starting');
        $this->registerSignalHandlers();

        $this->eventDispatcher->dispatch(
            ResqueWorkerEvents::START_UP,
            new WorkerEvent($this)
        );
    }
98103
protected function onInit()
    {
        $this->groupColumns = $this->parseGroups(Utility::get($this->params, "by"));
        $this->sumColumns = $this->parseGroups(Utility::get($this->params, "sum"));
        $this->countColumns = $this->parseGroups(Utility::get($this->params, "count"));
        $this->avgColumns = $this->parseGroups(Utility::get($this->params, "avg"));
        $this->minColumns = $this->parseGroups(Utility::get($this->params, "min"));
        $this->maxColumns = $this->parseGroups(Utility::get($this->params, "max"));

        $this->sort = Utility::get($this->params, "sort", true);
        $this->gData = array();
        $this->cData = array();
    }
312389
function () {
			BaseController.prototype.onInit.call(this);

			// manually call the handler once at startup as device API won't do this for us
			this._onOrientationChange({
				landscape: Device.orientation.landscape
			});

			this.getRouter().getRoute("tools").attachPatternMatched(this._onMatched, this);
		}
41750
public static function onWorkerStart() {
		Yesf::app()->loadEnvConfig();
		Yesf::loadProjectConfig();
		Logger::init();
		Response::init();
		Response::initInWorker();
		Utils::setRDAlias();
		Utils::setCacheAlias();
		Pool::init();
	}
303346
public function onReady()
    {
        \PHPDaemon\Servers\WebSocket\Pool::getInstance()->addRoute(
            '/sockjs',
            function ($client) {
                return new SimpleRoute($client, $this);
            }
        );
    }
591350
protected function onInit()
    {
        if (is_array($this->params)) {
            $this->override = Utility::get($this->params, "{override}", false);
        }

    }
1000700
protected function onStart()
    {
        do {
            // Disconnect and reconnect
            $this->reconnect();

            // If we successfully connected and we're supposed to be running,
            // call the onConnect event
            if ($this->_conn && ! feof($this->_conn) && $this->_state == parent::STATE_RUNNING) {
                $this->onConnect();
            }

            // Params for stream_select
            $read = array($this->_conn);
            $write = null;
            $except = null;

            $buf = '';

            // Loop while the connection is valid using stream_select with a
            // timeout. The timeout allows us to check to see if a stop has been
            // requested.
            while ($this->_conn && ! feof($this->_conn) &&
                ($count = stream_select($read, $write, $except, $this->_read_timeout))) {
                // Only continue if we're in the right state
                if ($this->_state != parent::STATE_RUNNING) {
                    break;
                }

                if (! $count) {
                    // Nothing waiting, listen again
                    continue;
                }

                // Set the stream as blocking
                stream_set_blocking($this->_conn, 1);
                stream_set_timeout($this->_conn, $this->_stream_timeout);

                // Get the chunk length
                $len = fgets($this->_conn, $this->_max_line_length);
                if ($len === false) {
                    // EOF
                    continue;
                }

                // Read and process each line
                while ($this->_state == parent::STATE_RUNNING &&
                    ($line = fgets($this->_conn, $this->_max_line_length)) !== false) {
                    if (strlen($line) == 0) {
                        // End of the chunk
                        break;
                    }

                    $this->onData($line);
                }

                // Set the stream as non-blocking
                if ($this->_conn) {
                    stream_set_blocking($this->_conn, 0);
                }
            }

            $this->onDisconnect();
        } while ($this->_conn && (! feof($this->_conn) || $this->_auto_reconnect) &&
            $this->_state == parent::STATE_RUNNING);

        // Make sure we're properly disconnected and in a known state
        $this->disconnect();

        // We've stopped for some reason, figure out why
        if ($this->_state == parent::STATE_STOPPING) {
            $reason = 'Stop requested';
        } else {
            $reason = 'Connection dropped';
        }

        // Now tell the user
        $this->onStop($reason);
    }