Phalcon Framework 3.4.5

TypeError: Argument 1 passed to Phalcon\Config::merge() must be an instance of Phalcon\Config, boolean given

/var/www/www.majorcadirect.com/apps/Bootstrap.php (61)
#0Phalcon\Config->merge(false)
/var/www/www.majorcadirect.com/apps/Bootstrap.php (61)
<?php
 
class Bootstrap extends \Phalcon\Mvc\Application
{
    private $modules;
    private $default_module = 'frontend';
 
    const MODE_PRODUCTION  = 'prod';
    const MODE_STAGING     = 'staging';
    const MODE_DEVELOPMENT = 'dev';
 
    public function __construct($default_module)
    {
        $this->modules = [
            'api'        => [
                'className' => 'App\Api\Module',
                'path'      => __DIR__ . '/Api/Module.php',
            ],
            'frontend'   => [
                'className' => 'App\Frontend\Module',
                'path'      => __DIR__ . '/Frontend/Module.php',
            ],
            'backoffice' => [
                'className' => 'App\Backoffice\Module',
                'path'      => __DIR__ . '/Backoffice/Module.php',
            ],
            'orion' => [
                'className' => 'App\Orion\Module',
                'path'      => __DIR__ . '/Orion/Module.php',
            ],
        ];
 
        $this->default_module = $default_module;
 
        $environment = trim(file_get_contents(__DIR__ . '/../config/environment.txt'));
 
        define('ENVIRONMENT', $environment);
 
        switch ($environment) {
            case self::MODE_PRODUCTION:
                error_reporting(0);
 
                break;
            case self::MODE_STAGING:
            case self::MODE_DEVELOPMENT:
                ini_set('display_errors', 'On');
                error_reporting(E_ALL);
 
                break;
        }
    }
 
    private function _registerServices()
    {
        $di             = new \Phalcon\DI\FactoryDefault();
        $modules        = $this->modules;
        $default_module = $this->default_module;
        $config         = include __DIR__ . '/../config/config.php';
        $env_config     = include __DIR__ . '/../config/config_' . ENVIRONMENT . '.php';
 
        $config->merge($env_config);
 
        include_once __DIR__ . '/../config/services.php';
        include_once __DIR__ . '/../config/managers.php';
        include_once __DIR__ . '/../config/routing.php';
 
        $this->setDI($di);
    }
 
    public function init()
    {
        if (ENVIRONMENT == 'prod') {
            $this->prod();
        } else {
            $this->dev();
        }
    }
 
    public function dev()
    {
        $debug = new \Phalcon\Debug();
        $debug->listen();
 
        $this->registerModules($this->modules);
        $this->_registerServices();
 
        echo $this->handle()->getContent();
    }
 
    public function prod()
    {
        try {
            $this->registerModules($this->modules);
            $this->_registerServices();
 
            echo $this->handle()->getContent();
        } catch (\Exception $e) {
            $s_logFile = __DIR__ . '/../storage/logs/' . date('Y-m-d') . '.log';
            $logger = new \Phalcon\Logger\Adapter\File($s_logFile, ['mode' => 'a+']);
            $logger->error($e->getMessage());
 
            // remove view contents from buffer
            ob_clean();
 
            $errorCode = 500;
            $errorView = __DIR__ . '/../public/errors/500.html';
 
            if (401 === $e->getCode()) {
                // 401 UNAUTHORIZED
                $errorCode = 401;
                $errorView = __DIR__ . '/../public/errors/401.html';
            } elseif (403 === $e->getCode()) {
                // 403 FORBIDDEN
                $errorCode = 403;
                $errorView = __DIR__ . '/../public/errors/403.html';
            } elseif (404 === $e->getCode()
                      || $e instanceof Phalcon\Mvc\View\Exception
                      || $e instanceof Phalcon\Mvc\Dispatcher\Exception) {
                // 404 NOT FOUND
                $errorCode = 404;
                $errorView = __DIR__ . '/../public/errors/404.html';
            }
 
            // 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();
        }
    }
}
#1Bootstrap->_registerServices()
/var/www/www.majorcadirect.com/apps/Bootstrap.php (85)
<?php
 
class Bootstrap extends \Phalcon\Mvc\Application
{
    private $modules;
    private $default_module = 'frontend';
 
    const MODE_PRODUCTION  = 'prod';
    const MODE_STAGING     = 'staging';
    const MODE_DEVELOPMENT = 'dev';
 
    public function __construct($default_module)
    {
        $this->modules = [
            'api'        => [
                'className' => 'App\Api\Module',
                'path'      => __DIR__ . '/Api/Module.php',
            ],
            'frontend'   => [
                'className' => 'App\Frontend\Module',
                'path'      => __DIR__ . '/Frontend/Module.php',
            ],
            'backoffice' => [
                'className' => 'App\Backoffice\Module',
                'path'      => __DIR__ . '/Backoffice/Module.php',
            ],
            'orion' => [
                'className' => 'App\Orion\Module',
                'path'      => __DIR__ . '/Orion/Module.php',
            ],
        ];
 
        $this->default_module = $default_module;
 
        $environment = trim(file_get_contents(__DIR__ . '/../config/environment.txt'));
 
        define('ENVIRONMENT', $environment);
 
        switch ($environment) {
            case self::MODE_PRODUCTION:
                error_reporting(0);
 
                break;
            case self::MODE_STAGING:
            case self::MODE_DEVELOPMENT:
                ini_set('display_errors', 'On');
                error_reporting(E_ALL);
 
                break;
        }
    }
 
    private function _registerServices()
    {
        $di             = new \Phalcon\DI\FactoryDefault();
        $modules        = $this->modules;
        $default_module = $this->default_module;
        $config         = include __DIR__ . '/../config/config.php';
        $env_config     = include __DIR__ . '/../config/config_' . ENVIRONMENT . '.php';
 
        $config->merge($env_config);
 
        include_once __DIR__ . '/../config/services.php';
        include_once __DIR__ . '/../config/managers.php';
        include_once __DIR__ . '/../config/routing.php';
 
        $this->setDI($di);
    }
 
    public function init()
    {
        if (ENVIRONMENT == 'prod') {
            $this->prod();
        } else {
            $this->dev();
        }
    }
 
    public function dev()
    {
        $debug = new \Phalcon\Debug();
        $debug->listen();
 
        $this->registerModules($this->modules);
        $this->_registerServices();
 
        echo $this->handle()->getContent();
    }
 
    public function prod()
    {
        try {
            $this->registerModules($this->modules);
            $this->_registerServices();
 
            echo $this->handle()->getContent();
        } catch (\Exception $e) {
            $s_logFile = __DIR__ . '/../storage/logs/' . date('Y-m-d') . '.log';
            $logger = new \Phalcon\Logger\Adapter\File($s_logFile, ['mode' => 'a+']);
            $logger->error($e->getMessage());
 
            // remove view contents from buffer
            ob_clean();
 
            $errorCode = 500;
            $errorView = __DIR__ . '/../public/errors/500.html';
 
            if (401 === $e->getCode()) {
                // 401 UNAUTHORIZED
                $errorCode = 401;
                $errorView = __DIR__ . '/../public/errors/401.html';
            } elseif (403 === $e->getCode()) {
                // 403 FORBIDDEN
                $errorCode = 403;
                $errorView = __DIR__ . '/../public/errors/403.html';
            } elseif (404 === $e->getCode()
                      || $e instanceof Phalcon\Mvc\View\Exception
                      || $e instanceof Phalcon\Mvc\Dispatcher\Exception) {
                // 404 NOT FOUND
                $errorCode = 404;
                $errorView = __DIR__ . '/../public/errors/404.html';
            }
 
            // 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();
        }
    }
}
#2Bootstrap->dev()
/var/www/www.majorcadirect.com/apps/Bootstrap.php (75)
<?php
 
class Bootstrap extends \Phalcon\Mvc\Application
{
    private $modules;
    private $default_module = 'frontend';
 
    const MODE_PRODUCTION  = 'prod';
    const MODE_STAGING     = 'staging';
    const MODE_DEVELOPMENT = 'dev';
 
    public function __construct($default_module)
    {
        $this->modules = [
            'api'        => [
                'className' => 'App\Api\Module',
                'path'      => __DIR__ . '/Api/Module.php',
            ],
            'frontend'   => [
                'className' => 'App\Frontend\Module',
                'path'      => __DIR__ . '/Frontend/Module.php',
            ],
            'backoffice' => [
                'className' => 'App\Backoffice\Module',
                'path'      => __DIR__ . '/Backoffice/Module.php',
            ],
            'orion' => [
                'className' => 'App\Orion\Module',
                'path'      => __DIR__ . '/Orion/Module.php',
            ],
        ];
 
        $this->default_module = $default_module;
 
        $environment = trim(file_get_contents(__DIR__ . '/../config/environment.txt'));
 
        define('ENVIRONMENT', $environment);
 
        switch ($environment) {
            case self::MODE_PRODUCTION:
                error_reporting(0);
 
                break;
            case self::MODE_STAGING:
            case self::MODE_DEVELOPMENT:
                ini_set('display_errors', 'On');
                error_reporting(E_ALL);
 
                break;
        }
    }
 
    private function _registerServices()
    {
        $di             = new \Phalcon\DI\FactoryDefault();
        $modules        = $this->modules;
        $default_module = $this->default_module;
        $config         = include __DIR__ . '/../config/config.php';
        $env_config     = include __DIR__ . '/../config/config_' . ENVIRONMENT . '.php';
 
        $config->merge($env_config);
 
        include_once __DIR__ . '/../config/services.php';
        include_once __DIR__ . '/../config/managers.php';
        include_once __DIR__ . '/../config/routing.php';
 
        $this->setDI($di);
    }
 
    public function init()
    {
        if (ENVIRONMENT == 'prod') {
            $this->prod();
        } else {
            $this->dev();
        }
    }
 
    public function dev()
    {
        $debug = new \Phalcon\Debug();
        $debug->listen();
 
        $this->registerModules($this->modules);
        $this->_registerServices();
 
        echo $this->handle()->getContent();
    }
 
    public function prod()
    {
        try {
            $this->registerModules($this->modules);
            $this->_registerServices();
 
            echo $this->handle()->getContent();
        } catch (\Exception $e) {
            $s_logFile = __DIR__ . '/../storage/logs/' . date('Y-m-d') . '.log';
            $logger = new \Phalcon\Logger\Adapter\File($s_logFile, ['mode' => 'a+']);
            $logger->error($e->getMessage());
 
            // remove view contents from buffer
            ob_clean();
 
            $errorCode = 500;
            $errorView = __DIR__ . '/../public/errors/500.html';
 
            if (401 === $e->getCode()) {
                // 401 UNAUTHORIZED
                $errorCode = 401;
                $errorView = __DIR__ . '/../public/errors/401.html';
            } elseif (403 === $e->getCode()) {
                // 403 FORBIDDEN
                $errorCode = 403;
                $errorView = __DIR__ . '/../public/errors/403.html';
            } elseif (404 === $e->getCode()
                      || $e instanceof Phalcon\Mvc\View\Exception
                      || $e instanceof Phalcon\Mvc\Dispatcher\Exception) {
                // 404 NOT FOUND
                $errorCode = 404;
                $errorView = __DIR__ . '/../public/errors/404.html';
            }
 
            // 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();
        }
    }
}
#3Bootstrap->init()
/var/www/www.majorcadirect.com/public/index.php (15)
<?php
 
header('Content-Type: text/html; charset=utf-8');
mb_internal_encoding('UTF-8');
date_default_timezone_set('Europe/London');
 
require_once __DIR__.'/../vendor/autoload.php';
require_once __DIR__.'/../apps/Bootstrap.php';
 
$app = new Bootstrap('frontend');
 
if (!defined('ENVIRONMENT')) {
    throw new \Exception('Invalid environment');
} else {
    $app->init();
}
KeyValue
KeyValue
USERwww-data
HOME/var/www
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS
HTTP_CF_CONNECTING_IP3.235.78.122
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/)
HTTP_CF_VISITOR{"scheme":"http"}
HTTP_X_FORWARDED_PROTOhttp
HTTP_CF_RAY722cc311eb016fa7-IAD
HTTP_X_FORWARDED_FOR3.235.78.122
HTTP_ACCEPT_ENCODINGgzip
HTTP_CONNECTIONKeep-Alive
HTTP_HOSTmajorcadirect.com
SCRIPT_FILENAME/var/www/www.majorcadirect.com/public/index.php
PATH_INFO
REDIRECT_STATUS200
SERVER_NAMEdefault
SERVER_PORT80
SERVER_ADDR163.172.53.116
REMOTE_PORT13298
REMOTE_ADDR172.70.174.187
SERVER_SOFTWAREnginx/1.18.0
GATEWAY_INTERFACECGI/1.1
REQUEST_SCHEMEhttp
SERVER_PROTOCOLHTTP/1.1
DOCUMENT_ROOT/var/www/www.majorcadirect.com/public
DOCUMENT_URI/index.php
REQUEST_URI/
SCRIPT_NAME/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHODGET
QUERY_STRING
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1656485783.49
REQUEST_TIME1656485783
#Path
0/var/www/www.majorcadirect.com/public/index.php
1/var/www/www.majorcadirect.com/vendor/autoload.php
2/var/www/www.majorcadirect.com/vendor/composer/autoload_real.php
3/var/www/www.majorcadirect.com/vendor/composer/platform_check.php
4/var/www/www.majorcadirect.com/vendor/composer/ClassLoader.php
5/var/www/www.majorcadirect.com/vendor/composer/autoload_static.php
6/var/www/www.majorcadirect.com/vendor/react/promise/src/functions_include.php
7/var/www/www.majorcadirect.com/vendor/react/promise/src/functions.php
8/var/www/www.majorcadirect.com/vendor/symfony/polyfill-mbstring/bootstrap.php
9/var/www/www.majorcadirect.com/vendor/ralouphie/getallheaders/src/getallheaders.php
10/var/www/www.majorcadirect.com/vendor/guzzlehttp/psr7/src/functions_include.php
11/var/www/www.majorcadirect.com/vendor/guzzlehttp/psr7/src/functions.php
12/var/www/www.majorcadirect.com/vendor/clue/stream-filter/src/functions.php
13/var/www/www.majorcadirect.com/vendor/php-http/message/src/filters.php
14/var/www/www.majorcadirect.com/vendor/paragonie/random_compat/lib/random.php
15/var/www/www.majorcadirect.com/vendor/swiftmailer/swiftmailer/lib/swift_required.php
16/var/www/www.majorcadirect.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
17/var/www/www.majorcadirect.com/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php
18/var/www/www.majorcadirect.com/vendor/symfony/polyfill-ctype/bootstrap.php
19/var/www/www.majorcadirect.com/vendor/symfony/var-dumper/Resources/functions/dump.php
20/var/www/www.majorcadirect.com/vendor/zendframework/zend-diactoros/src/functions/create_uploaded_file.php
21/var/www/www.majorcadirect.com/vendor/zendframework/zend-diactoros/src/functions/marshal_headers_from_sapi.php
22/var/www/www.majorcadirect.com/vendor/zendframework/zend-diactoros/src/functions/marshal_method_from_sapi.php
23/var/www/www.majorcadirect.com/vendor/zendframework/zend-diactoros/src/functions/marshal_protocol_version_from_sapi.php
24/var/www/www.majorcadirect.com/vendor/zendframework/zend-diactoros/src/functions/marshal_uri_from_sapi.php
25/var/www/www.majorcadirect.com/vendor/zendframework/zend-diactoros/src/functions/normalize_server.php
26/var/www/www.majorcadirect.com/vendor/zendframework/zend-diactoros/src/functions/normalize_uploaded_files.php
27/var/www/www.majorcadirect.com/vendor/zendframework/zend-diactoros/src/functions/parse_cookie_header.php
28/var/www/www.majorcadirect.com/vendor/facebook/graph-sdk/src/Facebook/polyfills.php
29/var/www/www.majorcadirect.com/vendor/guzzlehttp/promises/src/functions_include.php
30/var/www/www.majorcadirect.com/vendor/guzzlehttp/promises/src/functions.php
31/var/www/www.majorcadirect.com/vendor/igorw/get-in/src/get_in.php
32/var/www/www.majorcadirect.com/vendor/mtdowling/jmespath.php/src/JmesPath.php
33/var/www/www.majorcadirect.com/vendor/psy/psysh/src/functions.php
34/var/www/www.majorcadirect.com/vendor/symfony/polyfill-iconv/bootstrap.php
35/var/www/www.majorcadirect.com/vendor/symfony/polyfill-php70/bootstrap.php
36/var/www/www.majorcadirect.com/vendor/symfony/polyfill-php72/bootstrap.php
37/var/www/www.majorcadirect.com/vendor/aws/aws-sdk-php/src/functions.php
38/var/www/www.majorcadirect.com/apps/Bootstrap.php
39/var/www/www.majorcadirect.com/config/config.php
Memory
Usage2097152