Phalcon Framework 3.4.4

Error: Call to a member function getTitle() on null

/srv/ChatHispanoEngine/releases/63/apps/Web/Controllers/NewsController.php (108)
#0ChatHispanoEngine\Web\Controllers\NewsController->viewAction(ayuda, x)
#1Phalcon\Dispatcher->callActionMethod(Object(ChatHispanoEngine\Web\Controllers\NewsController), viewAction, Array([type] => ayuda, [slug] => x))
#2Phalcon\Dispatcher->dispatch()
#3Phalcon\Mvc\Application->handle()
/srv/ChatHispanoEngine/releases/63/apps/Application.php (133)
<?php
 
// namespace ChatHispanoEngine;
 
/**
 * Application driver class to initialize Phalcon and
 * other resources.
 */
class Application extends \Phalcon\Mvc\Application
{
    private static $mode = 'dev';
    private static $modules;
 
    private static $DEFAULT_MODULE = 'api';
 
    const MODE_PRODUCTION = 'prod';
    const MODE_STAGING = 'staging';
    const MODE_TEST = 'test';
    const MODE_DEVELOPMENT = 'dev';
 
    /**
     * Set application mode and error reporting level.
     */
    public function __construct($defaultModule, $env = 'dev')
    {
        static::$modules = array(
            'core' => array(
                'className' => 'ChatHispanoEngine\Core\Module',
                'path' => __DIR__.'/Core/Module.php',
            ),
            'api' => array(
                'className' => 'ChatHispanoEngine\Api\Module',
                'path' => __DIR__.'/Api/Module.php',
            ),
            'login' => array(
                'className' => 'ChatHispanoEngine\Login\Module',
                'path' => __DIR__.'/Login/Module.php',
            ),
            'web' => array(
                'className' => 'ChatHispanoEngine\Web\Module',
                'path' => __DIR__.'/Web/Module.php',
            ),
            'backoffice' => array(
                'className' => 'ChatHispanoEngine\Backoffice\Module',
                'path' => __DIR__.'/Backoffice/Module.php',
            ),
            'movil' => array(
                'className' => 'ChatHispanoEngine\Movil\Module',
                'path' => __DIR__.'/Movil/Module.php',
            ),
            'regwebexternal' => array(
                'className' => 'ChatHispanoEngine\RegWebExternal\Module',
                'path' => __DIR__.'/Regwebexternal/Module.php',
            ),
            'cdn' => array(
                'className' => 'ChatHispanoEngine\Cdn\Module',
                'path' => __DIR__.'/Cdn/Module.php',
            ),
            'shorten' => array(
                'className' => 'ChatHispanoEngine\Shorten\Module',
                'path' => __DIR__.'/Shorten/Module.php',
            ),
        );
 
        static::$DEFAULT_MODULE = $defaultModule;
        self::$mode = $env;
 
        self::$mode = trim(file_get_contents(__DIR__.'/../config/environment.txt'));
        define('ENVIRONMENT', self::$mode);
 
        if (!defined('PHALCON_MODE')) {
            $mode = getenv('PHALCON_MODE');
            $mode = $mode ? $mode : self::$mode;
            define('PHALCON_MODE', $mode);
        }
 
        switch (self::getMode()) {
            case self::MODE_PRODUCTION:
            case self::MODE_STAGING:
                error_reporting(0);
                break;
            case self::MODE_TEST:
            case self::MODE_DEVELOPMENT:
                ini_set('display_errors', 'On');
                error_reporting(E_ALL);
                break;
        }
    }
 
    /**
     * Register the services here to make them general or register in
     * the ModuleDefinition to make them module-specific.
     */
    protected function _registerServices()
    {
        $defaultModule = self::$DEFAULT_MODULE;
        $modules = self::$modules;
        $config = include __DIR__.'/../config/config.php';
        $env_config = include __DIR__.'/../config/config_'.ENVIRONMENT.'.php';
        $config->merge($env_config);
 
        $di = new \Phalcon\DI\FactoryDefault();
 
        include __DIR__.'/../config/loader.php';
        include __DIR__.'/../config/services.php';
        include __DIR__.'/../config/routing.php';
 
        $this->setDI($di);
    }
 
    /**
     * Run the application.
     */
    public function main()
    {
        if (static::MODE_PRODUCTION === static::getMode()) {
            $this->mainProd();
        } else {
            $this->mainDev();
        }
    }
 
    /**
     * Run the development environment.
     */
    private function mainDev()
    {
        (new \Phalcon\Debug())->listen();
 
        $this->_registerServices();
        $this->registerModules(self::$modules);
 
        echo $this->handle()->getContent();
    }
 
    /**
     * Run the production environment.
     */
    private function mainProd()
    {
        try {
            $this->registerModules(self::$modules);
            $this->_registerServices();
 
            echo $this->handle()->getContent();
        } catch (\Exception $e) {
            $logger = new \Phalcon\Logger\Adapter\File(__DIR__.'/../logs/'.date('Y-m-d').'.log');
            $logger->log("[".$e->getCode()."] ".$e->getMessage()." at ".$e->getFile()." (".$e->getLine().")", \Phalcon\Logger::ERROR);
 
            // remove view contents from buffer
            ob_clean();
 
            $errorCode = 500;
            $errorView = __DIR__.'/../public/errors/error.html';
 
            if (401 === $e->getCode()) {
                // 401 UNAUTHORIZED
                $errorCode = 401;
            } elseif (403 === $e->getCode()) {
                // 403 FORBIDDEN
                $errorCode = 403;
            } elseif (404 === $e->getCode()
                || $e instanceof Phalcon\Mvc\View\Exception
                || $e instanceof Phalcon\Mvc\Dispatcher\Exception) {
                // 404 NOT FOUND
                $errorCode = 404;
            }
 
            // Get error view contents. Since we are including the view
            // file here you can use PHP and local vars inside the error view.
            ob_start();
            include_once $errorView;
            $contents = ob_get_contents();
            ob_end_clean();
 
            // send view to header
            $response = $this->getDI()->getShared('response');
            $response->resetHeaders()
                ->setStatusCode($errorCode, null)
                ->setContent($contents)
                ->send()
            ;
 
            /**
             * We try to register in MongoDB the error to be able to
             * track it in backoffice and/or receive emails
             */
            try {
                $system_log_manager = $this->getDI()->get('system_log_manager');
                if ($errorCode == 500) {
                    $system_log_manager->createError([
                        'ip' => $_SERVER['SERVER_ADDR'],
                        'host' => $_SERVER['SERVER_NAME'],
                        'process' => 'php-fpm',
                        'message' => $e->getMessage(),
                        'file' => $e->getFile(),
                        'line' => $e->getLine(),
                    ]);
                } else {
                    $system_log_manager->createWarning([
                        'ip' => $_SERVER['SERVER_ADDR'],
                        'host' => $_SERVER['SERVER_NAME'],
                        'process' => 'php-fpm',
                        'message' => $e->getMessage(),
                        'file' => $e->getFile(),
                        'line' => $e->getLine(),
                    ]);
                }
            } catch (\Exception $e) {
            }
        }
    }
 
    /**
     * Get the current mode.
     *
     * @return string
     */
    public static function getMode()
    {
        return self::$mode;
    }
}
#4Application->mainDev()
/srv/ChatHispanoEngine/releases/63/apps/Application.php (119)
<?php
 
// namespace ChatHispanoEngine;
 
/**
 * Application driver class to initialize Phalcon and
 * other resources.
 */
class Application extends \Phalcon\Mvc\Application
{
    private static $mode = 'dev';
    private static $modules;
 
    private static $DEFAULT_MODULE = 'api';
 
    const MODE_PRODUCTION = 'prod';
    const MODE_STAGING = 'staging';
    const MODE_TEST = 'test';
    const MODE_DEVELOPMENT = 'dev';
 
    /**
     * Set application mode and error reporting level.
     */
    public function __construct($defaultModule, $env = 'dev')
    {
        static::$modules = array(
            'core' => array(
                'className' => 'ChatHispanoEngine\Core\Module',
                'path' => __DIR__.'/Core/Module.php',
            ),
            'api' => array(
                'className' => 'ChatHispanoEngine\Api\Module',
                'path' => __DIR__.'/Api/Module.php',
            ),
            'login' => array(
                'className' => 'ChatHispanoEngine\Login\Module',
                'path' => __DIR__.'/Login/Module.php',
            ),
            'web' => array(
                'className' => 'ChatHispanoEngine\Web\Module',
                'path' => __DIR__.'/Web/Module.php',
            ),
            'backoffice' => array(
                'className' => 'ChatHispanoEngine\Backoffice\Module',
                'path' => __DIR__.'/Backoffice/Module.php',
            ),
            'movil' => array(
                'className' => 'ChatHispanoEngine\Movil\Module',
                'path' => __DIR__.'/Movil/Module.php',
            ),
            'regwebexternal' => array(
                'className' => 'ChatHispanoEngine\RegWebExternal\Module',
                'path' => __DIR__.'/Regwebexternal/Module.php',
            ),
            'cdn' => array(
                'className' => 'ChatHispanoEngine\Cdn\Module',
                'path' => __DIR__.'/Cdn/Module.php',
            ),
            'shorten' => array(
                'className' => 'ChatHispanoEngine\Shorten\Module',
                'path' => __DIR__.'/Shorten/Module.php',
            ),
        );
 
        static::$DEFAULT_MODULE = $defaultModule;
        self::$mode = $env;
 
        self::$mode = trim(file_get_contents(__DIR__.'/../config/environment.txt'));
        define('ENVIRONMENT', self::$mode);
 
        if (!defined('PHALCON_MODE')) {
            $mode = getenv('PHALCON_MODE');
            $mode = $mode ? $mode : self::$mode;
            define('PHALCON_MODE', $mode);
        }
 
        switch (self::getMode()) {
            case self::MODE_PRODUCTION:
            case self::MODE_STAGING:
                error_reporting(0);
                break;
            case self::MODE_TEST:
            case self::MODE_DEVELOPMENT:
                ini_set('display_errors', 'On');
                error_reporting(E_ALL);
                break;
        }
    }
 
    /**
     * Register the services here to make them general or register in
     * the ModuleDefinition to make them module-specific.
     */
    protected function _registerServices()
    {
        $defaultModule = self::$DEFAULT_MODULE;
        $modules = self::$modules;
        $config = include __DIR__.'/../config/config.php';
        $env_config = include __DIR__.'/../config/config_'.ENVIRONMENT.'.php';
        $config->merge($env_config);
 
        $di = new \Phalcon\DI\FactoryDefault();
 
        include __DIR__.'/../config/loader.php';
        include __DIR__.'/../config/services.php';
        include __DIR__.'/../config/routing.php';
 
        $this->setDI($di);
    }
 
    /**
     * Run the application.
     */
    public function main()
    {
        if (static::MODE_PRODUCTION === static::getMode()) {
            $this->mainProd();
        } else {
            $this->mainDev();
        }
    }
 
    /**
     * Run the development environment.
     */
    private function mainDev()
    {
        (new \Phalcon\Debug())->listen();
 
        $this->_registerServices();
        $this->registerModules(self::$modules);
 
        echo $this->handle()->getContent();
    }
 
    /**
     * Run the production environment.
     */
    private function mainProd()
    {
        try {
            $this->registerModules(self::$modules);
            $this->_registerServices();
 
            echo $this->handle()->getContent();
        } catch (\Exception $e) {
            $logger = new \Phalcon\Logger\Adapter\File(__DIR__.'/../logs/'.date('Y-m-d').'.log');
            $logger->log("[".$e->getCode()."] ".$e->getMessage()." at ".$e->getFile()." (".$e->getLine().")", \Phalcon\Logger::ERROR);
 
            // remove view contents from buffer
            ob_clean();
 
            $errorCode = 500;
            $errorView = __DIR__.'/../public/errors/error.html';
 
            if (401 === $e->getCode()) {
                // 401 UNAUTHORIZED
                $errorCode = 401;
            } elseif (403 === $e->getCode()) {
                // 403 FORBIDDEN
                $errorCode = 403;
            } elseif (404 === $e->getCode()
                || $e instanceof Phalcon\Mvc\View\Exception
                || $e instanceof Phalcon\Mvc\Dispatcher\Exception) {
                // 404 NOT FOUND
                $errorCode = 404;
            }
 
            // Get error view contents. Since we are including the view
            // file here you can use PHP and local vars inside the error view.
            ob_start();
            include_once $errorView;
            $contents = ob_get_contents();
            ob_end_clean();
 
            // send view to header
            $response = $this->getDI()->getShared('response');
            $response->resetHeaders()
                ->setStatusCode($errorCode, null)
                ->setContent($contents)
                ->send()
            ;
 
            /**
             * We try to register in MongoDB the error to be able to
             * track it in backoffice and/or receive emails
             */
            try {
                $system_log_manager = $this->getDI()->get('system_log_manager');
                if ($errorCode == 500) {
                    $system_log_manager->createError([
                        'ip' => $_SERVER['SERVER_ADDR'],
                        'host' => $_SERVER['SERVER_NAME'],
                        'process' => 'php-fpm',
                        'message' => $e->getMessage(),
                        'file' => $e->getFile(),
                        'line' => $e->getLine(),
                    ]);
                } else {
                    $system_log_manager->createWarning([
                        'ip' => $_SERVER['SERVER_ADDR'],
                        'host' => $_SERVER['SERVER_NAME'],
                        'process' => 'php-fpm',
                        'message' => $e->getMessage(),
                        'file' => $e->getFile(),
                        'line' => $e->getLine(),
                    ]);
                }
            } catch (\Exception $e) {
            }
        }
    }
 
    /**
     * Get the current mode.
     *
     * @return string
     */
    public static function getMode()
    {
        return self::$mode;
    }
}
#5Application->main()
/srv/ChatHispanoEngine/releases/63/public/index.php (13)
<?php
 
date_default_timezone_set('Europe/Madrid');
 
require_once __DIR__.'/../vendor/autoload.php';
require_once __DIR__.'/../apps/Application.php';
 
if (isset($_SERVER['PHALCON_APP'])) {
    $app = new Application($_SERVER['PHALCON_APP']);
} else {
    $app = new Application('web');
}
$app->main();
KeyValue
_url/ayuda/x
KeyValue
USERwww-data
HOME/var/www
HTTP_CONNECTIONclose
HTTP_X_FORWARDED_FOR3.236.214.224
HTTP_X_FORWARDED_PROTOhttp
HTTP_HOSTtest.chathispano.com
HTTP_ACCEPT_ENCODINGbr,gzip
HTTP_IF_MODIFIED_SINCEFri, 14 Aug 2020 00:17:34 GMT
HTTP_ACCEPT_LANGUAGEen-US,en;q=0.5
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENTCCBot/2.0 (https://commoncrawl.org/faq/)
DISABLE_ANTEVENIO0
DISABLE_MOBUSI0
DISABLE_MASSARIUS0
DISABLE_RELATEDCONTENT0
DISABLE_ADSENSE0
ADS_DEFER0
PHALCON_APPweb
CHATHISPANOENGINE_REVISIONdevelopment
CHATHISPANOENGINE_INSTANCEvirtualbox
SCRIPT_FILENAME/srv/ChatHispanoEngine/releases/63/public/index.php
PATH_TRANSLATED/srv/ChatHispanoEngine/current/public
PATH_INFO
REDIRECT_STATUS200
SERVER_NAMEtest.chathispano.com
SERVER_PORT80
SERVER_ADDR10.234.61.101
REMOTE_PORT41738
REMOTE_ADDR10.234.61.52
SERVER_SOFTWAREnginx/1.14.2
GATEWAY_INTERFACECGI/1.1
REQUEST_SCHEMEhttp
SERVER_PROTOCOLHTTP/1.1
DOCUMENT_ROOT/srv/ChatHispanoEngine/releases/63/public
DOCUMENT_URI/index.php
REQUEST_URI/ayuda/x
SCRIPT_NAME/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHODGET
QUERY_STRING_url=/ayuda/x
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1624395853.6083
REQUEST_TIME1624395853
#Path
0/srv/ChatHispanoEngine/releases/63/public/index.php
1/srv/ChatHispanoEngine/releases/63/vendor/autoload.php
2/srv/ChatHispanoEngine/releases/63/vendor/composer/autoload_real.php
3/srv/ChatHispanoEngine/releases/63/vendor/composer/platform_check.php
4/srv/ChatHispanoEngine/releases/63/vendor/composer/ClassLoader.php
5/srv/ChatHispanoEngine/releases/63/vendor/composer/include_paths.php
6/srv/ChatHispanoEngine/releases/63/vendor/composer/autoload_static.php
7/srv/ChatHispanoEngine/releases/63/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php
8/srv/ChatHispanoEngine/releases/63/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php
9/srv/ChatHispanoEngine/releases/63/vendor/react/promise/src/functions_include.php
10/srv/ChatHispanoEngine/releases/63/vendor/react/promise/src/functions.php
11/srv/ChatHispanoEngine/releases/63/vendor/symfony/polyfill-php80/bootstrap.php
12/srv/ChatHispanoEngine/releases/63/vendor/symfony/polyfill-mbstring/bootstrap.php
13/srv/ChatHispanoEngine/releases/63/vendor/symfony/polyfill-intl-normalizer/bootstrap.php
14/srv/ChatHispanoEngine/releases/63/vendor/symfony/polyfill-ctype/bootstrap.php
15/srv/ChatHispanoEngine/releases/63/vendor/ralouphie/getallheaders/src/getallheaders.php
16/srv/ChatHispanoEngine/releases/63/vendor/guzzlehttp/psr7/src/functions_include.php
17/srv/ChatHispanoEngine/releases/63/vendor/guzzlehttp/psr7/src/functions.php
18/srv/ChatHispanoEngine/releases/63/vendor/symfony/polyfill-intl-grapheme/bootstrap.php
19/srv/ChatHispanoEngine/releases/63/vendor/react/promise-timer/src/functions_include.php
20/srv/ChatHispanoEngine/releases/63/vendor/react/promise-timer/src/functions.php
21/srv/ChatHispanoEngine/releases/63/vendor/guzzlehttp/promises/src/functions_include.php
22/srv/ChatHispanoEngine/releases/63/vendor/guzzlehttp/promises/src/functions.php
23/srv/ChatHispanoEngine/releases/63/vendor/symfony/string/Resources/functions.php
24/srv/ChatHispanoEngine/releases/63/vendor/symfony/polyfill-php73/bootstrap.php
25/srv/ChatHispanoEngine/releases/63/vendor/symfony/polyfill-php72/bootstrap.php
26/srv/ChatHispanoEngine/releases/63/vendor/symfony/polyfill-intl-idn/bootstrap.php
27/srv/ChatHispanoEngine/releases/63/vendor/guzzlehttp/guzzle/src/functions_include.php
28/srv/ChatHispanoEngine/releases/63/vendor/guzzlehttp/guzzle/src/functions.php
29/srv/ChatHispanoEngine/releases/63/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php
30/srv/ChatHispanoEngine/releases/63/vendor/symfony/var-dumper/Resources/functions/dump.php
31/srv/ChatHispanoEngine/releases/63/vendor/swiftmailer/swiftmailer/lib/swift_required.php
32/srv/ChatHispanoEngine/releases/63/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
33/srv/ChatHispanoEngine/releases/63/vendor/psy/psysh/src/functions.php
34/srv/ChatHispanoEngine/releases/63/vendor/facebook/graph-sdk/src/Facebook/polyfills.php
35/srv/ChatHispanoEngine/releases/63/vendor/ratchet/pawl/src/functions_include.php
36/srv/ChatHispanoEngine/releases/63/vendor/ratchet/pawl/src/functions.php
37/srv/ChatHispanoEngine/releases/63/apps/Application.php
38/srv/ChatHispanoEngine/releases/63/config/config.php
39/srv/ChatHispanoEngine/releases/63/config/config_staging.php
40/srv/ChatHispanoEngine/releases/63/config/loader.php
41/srv/ChatHispanoEngine/releases/63/config/services.php
42/srv/ChatHispanoEngine/releases/63/config/managers.php
43/srv/ChatHispanoEngine/releases/63/config/routing.php
44/srv/ChatHispanoEngine/releases/63/apps/Web/config/routing.php
45/srv/ChatHispanoEngine/releases/63/apps/Web/Module.php
46/srv/ChatHispanoEngine/releases/63/apps/Web/config/config.php
47/srv/ChatHispanoEngine/releases/63/apps/Web/config/services.php
48/srv/ChatHispanoEngine/releases/63/apps/Web/config/managers.php
49/srv/ChatHispanoEngine/releases/63/apps/Web/Controllers/NewsController.php
50/srv/ChatHispanoEngine/releases/63/apps/Web/Controllers/BaseController.php
51/srv/ChatHispanoEngine/releases/63/apps/Core/Controllers/BaseController.php
52/srv/ChatHispanoEngine/releases/63/vendor/iwalkalone/translator/src/iwalkalone/Translator.php
53/srv/ChatHispanoEngine/releases/63/apps/Web/Auth/Auth.php
54/srv/ChatHispanoEngine/releases/63/apps/Core/Managers/InspIRCd/GlineManager.php
55/srv/ChatHispanoEngine/releases/63/apps/Core/Models/InspIRCd/Gline.php
56/srv/ChatHispanoEngine/releases/63/vendor/phalcon/incubator/Library/Phalcon/Mvc/MongoCollection.php
57/srv/ChatHispanoEngine/releases/63/vendor/phalcon/incubator/Library/Phalcon/Db/Adapter/MongoDB/Client.php
58/srv/ChatHispanoEngine/releases/63/vendor/phalcon/incubator/Library/Phalcon/Db/Adapter/MongoDB/Database.php
59/srv/ChatHispanoEngine/releases/63/vendor/phalcon/incubator/Library/Phalcon/Db/Adapter/MongoDB/Collection.php
60/srv/ChatHispanoEngine/releases/63/vendor/phalcon/incubator/Library/Phalcon/Db/Adapter/MongoDB/Operation/Find.php
61/srv/ChatHispanoEngine/releases/63/vendor/phalcon/incubator/Library/Phalcon/Db/Adapter/MongoDB/Operation/Executable.php
62/srv/ChatHispanoEngine/releases/63/vendor/phalcon/incubator/Library/Phalcon/Db/Adapter/MongoDB/Model/BSONArray.php
63/srv/ChatHispanoEngine/releases/63/vendor/phalcon/incubator/Library/Phalcon/Db/Adapter/MongoDB/Model/BSONDocument.php
64/srv/ChatHispanoEngine/releases/63/apps/Core/Managers/InspIRCd/ChannelManager.php
65/srv/ChatHispanoEngine/releases/63/apps/Core/Models/Channel/Datasheet.php
66/srv/ChatHispanoEngine/releases/63/apps/Core/Models/InspIRCd/Channel.php
67/srv/ChatHispanoEngine/releases/63/apps/Core/Managers/NewsManager.php
68/srv/ChatHispanoEngine/releases/63/apps/Core/Models/News.php
69/srv/ChatHispanoEngine/releases/63/apps/Core/Exception/Exception.php
70/srv/ChatHispanoEngine/releases/63/apps/Core/Exception/ErrorCodes.php
71/srv/ChatHispanoEngine/releases/63/apps/Core/Library/Flash.php
Memory
Usage4194304