Phalcon Framework 5.1.2

TypeError: json_decode(): Argument #1 ($json) must be of type string, array given

/var/www/app/app/modules/frontend/controllers/FeedController.php (33)
#0json_decode
/var/www/app/app/modules/frontend/controllers/FeedController.php (33)
<?php
/**
 * Created by Rusalin Iliev https://rusaliniliev.com
 * for rusaliniliev
 * Date: 19.11.18
 * Time: 16:26
 */
 
namespace Shop\Modules\Frontend\Controllers;
 
use Shop\Helpers,
    Shop\Models\Pages,
    \DateTime,
    Shop\Models\Galleries;
 
 
class FeedController extends ControllerBase
{
    public function indexAction()
    {
 
        $galleries = $this->tagCache->getOrSet($this->tagCache->_genKey(['rsfeed_galleries_' . time(), $this->session->get('lg')]), function () {
            return Galleries::find([
                "conditions" => "visible = 1",
                "order" => "created_at desc"
 
            ]);
        }, ['galleries', 'rssfeed']);
 
 
        $feed = [];
        foreach ($galleries as $k => $g) {
            $images = json_decode($g->all_images, true);
 
            foreach ($images as $kk => $im) {
 
                $feed[] = [
                    'id' => $kk,
                    'name' => $im['title'][$this->session->lg],
                    'slug' => Helpers::getTranslationFromJson($g->slug),
                    'info' => $im['description'][$this->session->lg],
                    'main_image' => $im['src'],
                    'created_at' => $g->created_at
                ];
            }
 
 
        }
 
 
//        var_dump($feed); exit;
 
        $this->view->setVars([
            'pageDescription' => 'Rusalin Iliev Studio',
            'feed' => $feed,
        ]);
 
 
        $this->response->setHeader('Content-Type', 'application/xml');
        $this->view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_ACTION_VIEW);
 
        $this->response->setContent($this->view->render('feed', 'index')->getContent());
        return $this->response;
 
    }
 
}
#1Shop\Modules\Frontend\Controllers\FeedController->indexAction
#2Phalcon\Dispatcher\AbstractDispatcher->callActionMethod
#3Phalcon\Dispatcher\AbstractDispatcher->dispatch
#4Phalcon\Mvc\Application->handle
/var/www/app/app/bootstrap_web.php (63)
<?php
declare(strict_types=1);
 
use Phalcon\Di\FactoryDefault;
use Phalcon\Mvc\Application;
 
error_reporting(E_ALL);
 
define('BASE_PATH', dirname(__DIR__));
define('APP_PATH', BASE_PATH . '/app');
 
//try {
    /**
     * The FactoryDefault Dependency Injector automatically registers the services that
     * provide a full stack framework. These default services can be overidden with custom ones.
     */
    $di = new FactoryDefault();
 
    /**
     * Include general services
     */
    require APP_PATH . '/config/services.php';
 
    /**
     * Include web environment specific services
     */
    require APP_PATH . '/config/services_web.php';
 
    /**
     * Get config service for use in inline setup below
     */
    $config = $di->getConfig();
 
    /**
     * Include Autoloader
     */
    include APP_PATH . '/config/loader.php';
 
    /**
     * Handle the request
     */
    $application = new Application($di);
 
    /**
     * Register application modules
     */
    $application->registerModules([
        'frontend' => ['className' => 'Shop\Modules\Frontend\Module'],
        'backend' => ['className' => 'Shop\Modules\Backend\Module'],
    ]);
 
    /**
     * Load composer
     */
    include APP_PATH . '../../vendor/autoload.php';
 
    /**
     * Include routes
     */
    require APP_PATH . '/config/routes.php';
 
    (new \Phalcon\Support\Debug())->listen();
    $application->handle($_SERVER['REQUEST_URI'])->send();
//} catch (\Exception $e) {
//    echo $e->getMessage() . '<br>';
//    echo '<pre>' . $e->getTraceAsString() . '</pre>';
//}
#5require(/var/www/app/app/bootstrap_web.php)
/var/www/app/public/index.php (3)
<?php
 
require '../app/bootstrap_web.php';
KeyValue
_url/feed
KeyValue
HOSTNAMEc94c4c7862c7
PHP_INI_DIR/usr/local/etc/php
SHLVL1
HOME/
PHP_LDFLAGS-Wl,-O1 -pie
PHP_CFLAGS-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PHP_VERSION8.1.24
GPG_KEYS528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD
PHP_CPPFLAGS-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PHP_ASC_URLhttps://www.php.net/distributions/php-8.1.24.tar.xz.asc
PHP_URLhttps://www.php.net/distributions/php-8.1.24.tar.xz
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LD_PRELOAD/usr/lib/preloadable_libiconv.so php
PHPIZE_DEPSautoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
PWD/var/www/app
PHP_SHA256ee61f6232bb29bd2e785daf325d2177f2272bf80d086c295a724594e710bce3d
SUPERVISOR_ENABLED1
SUPERVISOR_PROCESS_NAMEphp-fpm
SUPERVISOR_GROUP_NAMEphp-fpm
USERnobody
HTTP_ACCEPT_ENCODINGbr,gzip
HTTP_IF_MODIFIED_SINCESat, 24 Feb 2024 19:48:44 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/)
HTTP_CONNECTIONclose
HTTP_X_FORWARDED_HOSTrusaliniliev.com
HTTP_X_FORWARDED_FOR100.28.132.102
HTTP_X_REAL_IP100.28.132.102
HTTP_HOSTrusaliniliev.com
REDIRECT_STATUS200
SERVER_NAME_
SERVER_PORT80
SERVER_ADDR192.168.32.6
REMOTE_PORT58198
REMOTE_ADDR95.158.131.135
SERVER_SOFTWAREnginx/1.24.0
GATEWAY_INTERFACECGI/1.1
REQUEST_SCHEMEhttp
SERVER_PROTOCOLHTTP/1.0
DOCUMENT_ROOT/var/www/app/public
DOCUMENT_URI/index.php
REQUEST_URI/feed
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHODGET
QUERY_STRING_url=/feed&
SCRIPT_NAME/index.php
SCRIPT_FILENAME/var/www/app/public/index.php
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1719271815.2742
REQUEST_TIME1719271815
#Path
0/var/www/app/public/index.php
1/var/www/app/app/bootstrap_web.php
2/var/www/app/app/config/services.php
3/var/www/app/app/config/services_web.php
4/var/www/app/app/config/config.php
5/var/www/app/app/config/loader.php
6/var/www/app/vendor/autoload.php
7/var/www/app/vendor/composer/autoload_real.php
8/var/www/app/vendor/composer/platform_check.php
9/var/www/app/vendor/composer/ClassLoader.php
10/var/www/app/vendor/composer/autoload_static.php
11/var/www/app/vendor/symfony/polyfill-mbstring/bootstrap.php
12/var/www/app/vendor/symfony/polyfill-mbstring/bootstrap80.php
13/var/www/app/vendor/symfony/deprecation-contracts/function.php
14/var/www/app/vendor/symfony/polyfill-ctype/bootstrap.php
15/var/www/app/vendor/symfony/polyfill-ctype/bootstrap80.php
16/var/www/app/vendor/symfony/polyfill-intl-grapheme/bootstrap.php
17/var/www/app/vendor/symfony/polyfill-intl-normalizer/bootstrap.php
18/var/www/app/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php
19/var/www/app/vendor/symfony/polyfill-php80/bootstrap.php
20/var/www/app/vendor/symfony/string/Resources/functions.php
21/var/www/app/vendor/symfony/var-dumper/Resources/functions/dump.php
22/var/www/app/vendor/psy/psysh/src/functions.php
23/var/www/app/vendor/swiftmailer/swiftmailer/lib/swift_required.php
24/var/www/app/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
25/var/www/app/vendor/symfony/translation/Resources/functions.php
26/var/www/app/app/config/routes.php
27/var/www/app/app/modules/frontend/Module.php
28/var/www/app/app/common/Plugins/UserPlugin/Plugin/Security.php
29/var/www/app/app/common/library/Throttler.php
30/var/www/app/app/common/Plugins/UserPlugin/Auth/Auth.php
31/var/www/app/app/common/library/PhalconThrottler/RedisThrottler.php
32/var/www/app/app/common/library/PhalconThrottler/ThrottlerInterface.php
33/var/www/app/app/modules/frontend/controllers/FeedController.php
34/var/www/app/app/modules/frontend/controllers/ControllerBase.php
35/var/www/app/app/common/library/Helpers.php
36/var/www/app/app/common/languages/en.php
37/var/www/app/app/common/library/Cache/CacheTags.php
38/var/www/app/app/common/library/Cache/TagsInterface.php
39/var/www/app/app/common/models/Galleries.php
40/var/www/app/app/common/traits/SerialiseTrait.php
Memory
Usage2097152