Phalcon Framework 3.1.2

Phalcon\Logger\Exception: Can't open log file at '/opt/suara2016/www/logs/test.log'

/opt/suara2016/www/apps/frontend/controllers/PressreleaseController.php (68)
#0Phalcon\Logger\Adapter\File->__construct(/opt/suara2016/www/logs/test.log)
/opt/suara2016/www/apps/frontend/controllers/PressreleaseController.php (68)
<?php
class PressreleaseController extends ControllerBase
{
    function onConstruct(){
 
    }
    
    public function indexAction($cat)
    {
        if($this->suaraApi->isPartUppercase($cat) == true)
        {
            $cat = strtolower($cat);
            return $this->response->redirect($this->mainUrl->get($cat),true, 301);    
        }
 
        if(is_numeric($cat))
        {
            return  $this->dispatcher->forward(array(
                        'controller' => 'error', 'action' =>   'error404')
                    );
        }
        
        $cat = strtolower($cat);
        $q = $this->suaraApi->get('berita/terkini/'. $cat .'/',['limit' => 21]);
        $data['results']=array_slice($q->results,1,20);
 
        if(!empty($q->results[0]))
        {
            $widget_html['headline'] = $this->portlet_engine->render('../../sharedlib/views/frontend/portlet/headline.volt',[
                                            'data' => (object)['results' => $q->results[0]]
                                            ]);    
        }
 
        $widget_html['terkini'] = $this->portlet_engine->render('../../sharedlib/views/frontend/portlet/list_006.volt',[
                                            'icon' => $this->config->category[$cat]['icon'],
                                            'dfp' => (object) ['kanal' => $cat, 'subkanal' => 'root'],
                                            'data' => (object)['results' => array_slice($q->results,1,20)]
                                            ]);
 
        $widget_html['wawancara'] = $this->portlet_engine->render('../../sharedlib/views/frontend/portlet/list_wawancara',[
                                            'title' => 'Wawancara',
                                            'slug' => 'wawancara',
                                            'data' => $this->suaraApi->get("berita/terkini/wawancara/",['limit' => 1])
                                        ]);
        
        $widget_html['foto'] = $this->portlet_engine->render('../../sharedlib/views/frontend/portlet/list_foto',[
                                            'title' => 'Foto',
                                            'slug' => 'foto',
                                            'data' => $this->suaraApi->get("berita/terkini/foto/",['limit' => 6])
                                        ]);
        
        $widget_html['video']=$this->portlet_engine->render('../../sharedlib/views/frontend/portlet/list_video',[
                                            'title' => 'Video',
                                            'slug' => 'video',
                                            'data' => $this->suaraApi->get("berita/terkini/video/",['limit' => 4])
                                        ]);
        
        $widget_html['terpopuler'] = $this->portlet_engine->render('../../sharedlib/views/frontend/portlet/list_002',[
                                            'title' => 'Terpopuler',
                                            'data' => $this->suaraApi->get("berita/popular/",['limit' => 5])
                                        ]);
        
        $widget_html['topik_pilihan'] = $this->portlet_engine->render('../../sharedlib/views/frontend/portlet/list_002',[
                                            'title' => 'Topik Pilihan',
                                            'data' => $this->suaraApi->get("berita/topstory/",['limit' => 4])
                                        ]);
 
        $logger = new \Phalcon\Logger\Adapter\File(BASE_PATH . "/logs/test.log");
        $logger->log(Phalcon\Version::get());
        $logger->close();
 
        $widget_html['tag'] = $this->tag(); #generic-portlet
        
        $widget_html['forum'] = $this->forum(); #generic-portlet
        
        //META TITLE
        $this->view->setVar('meta_title',$this->config->meta['default']['meta_title'].' - '.ucfirst($cat));
        $this->view->setVar('meta_desc',$this->config->meta['default']['meta_desc'].', '.$cat);
        $this->view->setVar('meta_keywords',$this->config->meta['default']['meta_keywords']);
 
        $this->view->setVar('portlet',$widget_html);
        $dfp = (object) ['kanal' => $cat, 'subkanal' => 'root'];
        $this->view->setVar('dfp', $dfp);
    }
 
}
 
#1PressreleaseController->indexAction(pressrelease)
#2Phalcon\Dispatcher->callActionMethod(Object(PressreleaseController), indexAction, Array([cat] => pressrelease))
#3Phalcon\Dispatcher->_dispatch()
#4Phalcon\Dispatcher->dispatch()
#5Phalcon\Mvc\Application->handle()
/opt/suara2016/www/public_frontend/bootstrap.php (195)
<?php if ( ! defined('ENVIRONMENT')) exit('No direct script access allowed');
 
$vendor = require '../vendor/autoload.php';
 
// Guess base path
$dir = str_replace('\\', '/', __DIR__);
$basePath = realpath('..'); //str_replace('public', '', $dir);
 
 
/*
|--------------------------------------------------------------------------
| Constants
|--------------------------------------------------------------------------
|
| When you develop, it's really important to get an easy access of your
| Base path and App paths
|
| We will guess for you the BasePath and AppPath
|
*/
define("SUARA_APP", 'frontend');
define('BASEPATH', $basePath);
define('APPPATH', BASEPATH . '/apps/'. SUARA_APP .'/');
 
/*
|--------------------------------------------------------------------------
| Dotenv
|--------------------------------------------------------------------------
|
*/
$dotenv = new Dotenv\Dotenv(BASEPATH);
$dotenv->load();
 
 
define("SUARA_ENV", isset($_ENV['APP_ENV'])?$_ENV['APP_ENV']:"production");
 
/*
|--------------------------------------------------------------------------
| ERROR REPORTING
|--------------------------------------------------------------------------
|
| Different environments will require different levels of error reporting.
| By default development will show errors but testing and live will hide them.
|
*/
if (defined('SUARA_ENV'))
{
    switch (SUARA_ENV)
    {
        case 'local':
        error_reporting(E_ALL);
        (new \Phalcon\Debug)->listen();
        break;
 
        case 'testing':
        case 'production':
        error_reporting(0);
        break;
 
        default:
        exit('The application environment is not set correctly in public/bootstrap.php');
    }
}
 
/*
|--------------------------------------------------------------------------
| Magic config
|--------------------------------------------------------------------------
|
| A simple system to fetch the app/config/config.php file and autoload 
| your custom config files added in the app/config/config.php into the 
| array "autoload => configs"
|
| @link http://docs.phalconphp.com/en/latest/api/Phalcon_Config.html
|
*/
 
// Init config var
$config = new \Phalcon\Config([]);
 
// Load config file of system
$tmp = require(APPPATH . 'config/config.php');
 
// Merge with the init config
$config->merge($tmp);
 
// Load custom config from autoload
if (isset($config->get('autoload')['configs']))
{
    
    $autoloadHelpers = $config->get('autoload')['helpers'];
    if ( ! empty($autoloadHelpers))
    {
        foreach ($autoloadHelpers as $helperToLoad)
        {
            if ( ! empty($helperToLoad))
            {   
                $dir = APPPATH . '../sharedlib/helpers/' . $helperToLoad . '.php';
                if(!file_exists($dir)){
                    echo 'Tolong kau check dulu file helpers '.$helperToLoad.'.php';
                    die;
                }
                require $dir;
            }
        }
    }
 
    $autoloadConfigs = $config->get('autoload')['configs'];
    if ( ! empty($autoloadConfigs))
    {
        foreach ($autoloadConfigs as $configToLoad)
        {
            if ( ! empty($configToLoad))
            {
                //$tmp = require(APPPATH . 'config/' . $configToLoad . '.php');
                $tmp = require($configToLoad);
 
                $config->merge($tmp);
            }
        }
    }
}
 
/*
|--------------------------------------------------------------------------
| Loader
|--------------------------------------------------------------------------
|
| We start the loader class of Phalcon and include the app/config/loader file
| to fetch datas.
|
| @link http://docs.phalconphp.com/en/latest/reference/loader.html
|
*/
 
// Register an autoloader
$loader = new \Phalcon\Loader();
 
// Fetch datas
require(APPPATH . 'config/loader.php');
 
// Register config
$loader->register();
 
 
/*
|--------------------------------------------------------------------------
| Dependency injection
|--------------------------------------------------------------------------
|
| Load DI, fetch datas, and run.
|
| Note : If the developer let blank the baseUri we will auto detect the 
| baseUrl to fit with his configuration. It's too a little tip to get
| a full URL and not a simple URI for links generated.
|
| @link http://docs.phalconphp.com/en/latest/api/Phalcon_DI.html
|
*/
$di = new Phalcon\DI\FactoryDefault();
 
// Fetch baseUri from app/config/config.php
if (isset($config->get('app')['baseUrl']))
{
    $uri = $config->get('app')['baseUrl'];
 
    if ( ! empty($uri))
    {
        $baseUrl = $uri;
    }
 
}
 
// If baseUri it's blank, we will auto guess
if ( ! isset($baseUrl))
{
    // Guess base uri
    $baseUrl = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
    $baseUrl .= "://".$_SERVER['HTTP_HOST'];
    $baseUrl .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
    $baseUrl = str_replace('public/', '', $baseUrl);
}
 
// Fetch datas
require(APPPATH . 'config/di.php');
 
 
// Handle the request and inject DI
$application = new \Phalcon\Mvc\Application($di);
 
$di['app'] = $application;
 
// Output !
(new Snowair\Debugbar\ServiceProvider(APPPATH .'../sharedlib/config/debugbar.php'))->start();
echo $application->handle()->getContent();
 
 
 
#6require(/opt/suara2016/www/public_frontend/bootstrap.php)
/opt/suara2016/www/public_frontend/index.php (55)
<?php
date_default_timezone_set('Asia/Jakarta');
/*
|--------------------------------------------------------------------------
| APPLICATION ENVIRONMENT
|--------------------------------------------------------------------------
|
| Usage is :
|
|     development
|     testing
|     production
|
| NOTE: If you change these, also change the error_reporting() code below
| and database configuration into app/config/config.php
|
*/
define('ENVIRONMENT', 'production');
 
/*
|--------------------------------------------------------------------------
| ERROR REPORTING
|--------------------------------------------------------------------------
|
| Different environments will require different levels of error reporting.
| By default development will show errors but testing and live will hide them.
|
*/
if (defined('ENVIRONMENT'))
{
  switch (ENVIRONMENT)
  {
    case 'development':
    error_reporting(E_ALL);
    break;
 
    case 'testing':
    case 'production':
    error_reporting(0);
    break;
 
    default:
    exit('The application environment is not set correctly in public/index.php');
  }
}
 
/*
|--------------------------------------------------------------------------
| Require bootstrap file
|--------------------------------------------------------------------------
|
| Init PhalconPHP and illuminate your development.
|
*/
require('bootstrap.php');
 
?>
KeyValue
KeyValue
USERwww-data
HOME/var/www
FCGI_ROLERESPONDER
QUERY_STRING
REQUEST_METHODGET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME/index.php
REQUEST_URI/pressrelease
DOCUMENT_URI/index.php
DOCUMENT_ROOT/opt/suara2016/www/public_frontend
SERVER_PROTOCOLHTTP/1.0
REQUEST_SCHEMEhttp
GATEWAY_INTERFACECGI/1.1
SERVER_SOFTWAREnginx/1.10.0
REMOTE_ADDR107.22.127.78
REMOTE_PORT47853
SERVER_ADDR128.199.119.43
SERVER_PORT80
SERVER_NAMEsuara.com
REDIRECT_STATUS200
SCRIPT_FILENAME/opt/suara2016/www/public_frontend/index.php
HTTP_HOSTwww.suara.com
HTTP_ACCEPT_ENCODINGx-gzip, gzip, deflate
HTTP_USER_AGENTCCBot/2.0 (http://commoncrawl.org/faq/)
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
PHP_SELF/index.php
REQUEST_TIME_FLOAT1493060628.4925
REQUEST_TIME1493060628
DEBUGfalse
APP_ENVlocal
DEBUGBAR_ENABLEDfalse
SUARA_REDIS_HOST10.130.52.114
SUARA_REDIS_PORT6379
SUARA_DESKTOP_URLhttp://www.suara.com/
SUARA_DESKTOP_ASSETS_URLhttp://assets.suara.com/frontend/
SUARA_MSITE_URLhttp://m.suara.com/
SUARA_MSITE_ASSETS_URLhttp://assets.suara.com/mobile/
SUARA_MICROSITE_URLhttp://microsite.suara.com/
SUARA_MICROSITE_ASSETS_URLhttp://assets.suara.com/frontend/
SUARA_MSITE_MICROSITE_URLhttp://m.microsite.suara.com/
SUARA_MSITE_MICROSITE_ASSETS_URLhttp://assets.suara.com/mobile/
SUARA_MEDIA_URLhttp://media.suara.com/
SUARA_API_URLhttp://api.beta.suara.com/v2/
SUARA_API_TOKENee81465ae7093b3e962573e29c484c4d83e889c1
SUARA_MEDIA_XMLhttp://static.suara.com/
SUARA_SITEKEY6LetZxcTAAAAAHazx3hjkR9sg7LbrdhAiV122IcX
SUARA_SECRET6LetZxcTAAAAAEL4JN2XHVGZ2mHVpSNMwxPEABnN
SUARA_MAIL_HOST127.0.0.1
SUARA_MAIL_FROMkontak.form@suara.com
SUARA_MAIL_SENDTOredaksi@suara.com
AMQP_HITCOUNT_HOST10.130.52.114
AMQP_HITCOUNT_PORT5672
AMQP_HITCOUNT_USERsuara
AMQP_HITCOUNT_PASSWORDr4bb1t@su@r
SUARA_GA_IDUA-48479604-1
ALEXA_VERIFY_IDiUEjKUBkewgkmEAaGPeYTWn-9Fs
FB_APP_ID802054763141639
FB_PAGE_ID636794109715023
SUARA_API_URL_OLDhttp://api.suara.com
SUARA_API_URL_OLD_IDhttp://api-id.suara.com
#Path
0/opt/suara2016/www/public_frontend/index.php
1/opt/suara2016/www/public_frontend/bootstrap.php
2/opt/suara2016/www/vendor/autoload.php
3/opt/suara2016/www/vendor/composer/autoload_real.php
4/opt/suara2016/www/vendor/composer/ClassLoader.php
5/opt/suara2016/www/vendor/composer/autoload_namespaces.php
6/opt/suara2016/www/vendor/composer/autoload_psr4.php
7/opt/suara2016/www/vendor/composer/autoload_classmap.php
8/opt/suara2016/www/vendor/composer/autoload_files.php
9/opt/suara2016/www/vendor/symfony/polyfill-mbstring/bootstrap.php
10/opt/suara2016/www/vendor/symfony/var-dumper/Resources/functions/dump.php
11/opt/suara2016/www/vendor/swiftmailer/swiftmailer/lib/swift_required.php
12/opt/suara2016/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
13/opt/suara2016/www/vendor/snowair/phalcon-debugbar/src/Debug.php
14/opt/suara2016/www/vendor/vlucas/phpdotenv/src/Dotenv.php
15/opt/suara2016/www/vendor/vlucas/phpdotenv/src/Loader.php
16/opt/suara2016/www/apps/frontend/config/config.php
17/opt/suara2016/www/apps/sharedlib/helpers/misc.php
18/opt/suara2016/www/apps/sharedlib/helpers/string.php
19/opt/suara2016/www/apps/sharedlib/helpers/media.php
20/opt/suara2016/www/apps/sharedlib/helpers/mainUrl.php
21/opt/suara2016/www/apps/sharedlib/helpers/mainAssets.php
22/opt/suara2016/www/apps/sharedlib/helpers/suaraAds.php
23/opt/suara2016/www/apps/sharedlib/helpers/mainSuara.php
24/opt/suara2016/www/apps/sharedlib/config/cache.php
25/opt/suara2016/www/apps/sharedlib/config/amqp.php
26/opt/suara2016/www/apps/sharedlib/config/meta_tag.php
27/opt/suara2016/www/apps/sharedlib/config/dfp.php
28/opt/suara2016/www/apps/sharedlib/config/suara.php
29/opt/suara2016/www/apps/sharedlib/config/category.php
30/opt/suara2016/www/apps/sharedlib/config/microsite.php
31/opt/suara2016/www/apps/frontend/config/loader.php
32/opt/suara2016/www/apps/frontend/config/di.php
33/opt/suara2016/www/vendor/snowair/phalcon-debugbar/src/ServiceProvider.php
34/opt/suara2016/www/apps/frontend/config/routes.php
35/opt/suara2016/www/vendor/snowair/phalcon-debugbar/src/PhalconDebugbar.php
36/opt/suara2016/www/vendor/maximebf/debugbar/src/DebugBar/DebugBar.php
37/opt/suara2016/www/vendor/snowair/phalcon-debugbar/src/config/debugbar.php
38/opt/suara2016/www/apps/sharedlib/config/debugbar.php
39/opt/suara2016/www/vendor/snowair/phalcon-debugbar/src/PhalconHttpDriver.php
40/opt/suara2016/www/vendor/maximebf/debugbar/src/DebugBar/HttpDriverInterface.php
41/opt/suara2016/www/apps/frontend/controllers/PressreleaseController.php
42/opt/suara2016/www/apps/frontend/controllers/ControllerBase.php
43/opt/suara2016/www/vendor/mobiledetect/mobiledetectlib/namespaced/Detection/MobileDetect.php
44/opt/suara2016/www/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php
45/opt/suara2016/www/apps/sharedlib/models/ContentPartner.php
46/opt/suara2016/www/apps/sharedlib/libraries/SuaraCache.php
47/opt/suara2016/www/vendor/tedivm/stash/src/Stash/Driver/Redis.php
48/opt/suara2016/www/vendor/tedivm/stash/src/Stash/Interfaces/DriverInterface.php
49/opt/suara2016/www/vendor/tedivm/stash/src/Stash/Pool.php
50/opt/suara2016/www/vendor/tedivm/stash/src/Stash/Interfaces/PoolInterface.php
51/opt/suara2016/www/apps/sharedlib/libraries/SuaraXml.php
52/opt/suara2016/www/apps/sharedlib/libraries/SuaraApi.php
53/opt/suara2016/www/apps/sharedlib/libraries/SuaraStatic.php
54/opt/suara2016/www/vendor/php-curl-class/php-curl-class/src/Curl/Curl.php
55/opt/suara2016/www/vendor/php-curl-class/php-curl-class/src/Curl/CaseInsensitiveArray.php
56/opt/suara2016/www/vendor/tedivm/stash/src/Stash/Item.php
57/opt/suara2016/www/vendor/tedivm/stash/src/Stash/Interfaces/ItemInterface.php
58/opt/suara2016/www/vendor/tedivm/stash/src/Stash/Utilities.php
59/opt/suara2016/www/vendor/tedivm/stash/src/Stash/Invalidation.php
60/opt/suara2016/www/apps/sharedlib/config/volt.php
61/opt/suara2016/www/cache/volt/frontend/portlet/_opt_suara2016_www_apps_sharedlib_views_frontend_portlet_headline.volt.php
62/opt/suara2016/www/cache/volt/frontend/portlet/_opt_suara2016_www_apps_sharedlib_views_frontend_portlet_list_006.volt.php
63/opt/suara2016/www/cache/volt/frontend/dfp/_opt_suara2016_www_apps_sharedlib_views_dfp_script_tag.volt.php
64/opt/suara2016/www/cache/volt/frontend/portlet/_opt_suara2016_www_apps_sharedlib_views_frontend_portlet_list_wawancara.volt.php
65/opt/suara2016/www/cache/volt/frontend/portlet/_opt_suara2016_www_apps_sharedlib_views_frontend_portlet_list_foto.volt.php
66/opt/suara2016/www/cache/volt/frontend/portlet/_opt_suara2016_www_apps_sharedlib_views_frontend_portlet_list_video.volt.php
67/opt/suara2016/www/cache/volt/frontend/portlet/_opt_suara2016_www_apps_sharedlib_views_frontend_portlet_list_002.volt.php
Memory
Usage5505024