Phalcon Framework 2.0.4

PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

/home/fides/engine/bootstrap/di.php (48)
#0PDO->__construct(mysql:host=localhost;dbname=fides_db;charset=utf8, fides, Limit2014, Array([3] => 2))
#1Phalcon\Db\Adapter\Pdo->connect(Array([host] => localhost, [username] => fides, [password] => Limit2014, [dbname] => fides_db, [charset] => utf8))
#2Phalcon\Db\Adapter\Pdo->__construct(Array([host] => localhost, [username] => fides, [password] => Limit2014, [dbname] => fides_db, [charset] => utf8))
/home/fides/engine/bootstrap/di.php (48)
<?php
 
// Powered by: Limit We are beyond that
// Owner: United Group
// All rights are reserved
 
// Declare namespaces to be used
use Phalcon\DI\FactoryDefault;
use Phalcon\Db\Adapter\Pdo\Mysql as DbAdapter;
use Phalcon\Mvc\View;
use Phalcon\Mvc\View\Engine\Volt;
use Phalcon\Session\Adapter\Files as SessionAdapter;
use Phalcon\Flash\Session as FlashSession;
use Phalcon\Events\Manager as EventsManager;
use Phalcon\Mvc\Dispatcher;
 
use Phalcon\Db\Profiler as Profiler;
 
// Create a DI ( Dependency Injection )
$di = new FactoryDefault();
 
// Add routing capabilities
$di->set('router', function(){
    require APPLICATION . 'bootstrap/router.php';
    return $router;
});
 
// Set config di
$di->set('config', $config);
 
// Set dispatcher service
$di->set('dispatcher', function() use ($di) {
  $eventsManager = new EventsManager;
  $eventsManager->attach('dispatch:beforeDispatch', new AuthPlugin);
  $dispatcher = new Dispatcher;
  $dispatcher->setEventsManager($eventsManager);
  return $dispatcher;
});
 
//Set the database service
$di->set('db', function() use ($config) {
   return new DbAdapter(array(
     "host"     => $config->database->host,
     "username" => $config->database->username,
     "password" => $config->database->password,
     "dbname"   => $config->database->dbname,
     "charset"  => 'utf8'
   ));
});
 
// Setting up the view component
$di->set('view', function() use ($config) {
  $view = new View();
  $view->setViewsDir($config->application->views);
  $view->registerEngines(array(
    ".volt" => 'volt'
  ));
  return $view;
});
 
// Setting up volt engine
$di->set('volt', function($view, $di) {
  $volt = new Volt($view, $di);
  $volt->setOptions(array(
    "compiledPath" => APPLICATION . "cache/volt/",
    "compiledSeparator" => "_",
    "compileAlways" => true
  ));
  $compiler = $volt->getCompiler();
  $compiler->addFunction('is_a', 'is_a');
  $compiler->addFunction('number_format', 'number_format');
  $compiler->addFunction('sizeof', 'sizeof');
  $compiler->addFunction('str_replace', 'str_replace');
  $compiler->addFunction('trim', 'trim');
  $compiler->addFunction('array', 'array');
  return $volt;
}, true);
 
// Start the session the first time some component request the session service
$di->set('session', function() {
  $session = new SessionAdapter();
  $session->start();
  return $session;
});
 
// Register the flash service with custom CSS classes
$di->set('flash', function(){
  return new FlashSession();
});
?>
#3{closure}()
#4Phalcon\Di\Service->resolve(null, Object(Phalcon\Di\FactoryDefault))
#5Phalcon\Di->get(db, null)
#6Phalcon\Di->getShared(db)
#7Phalcon\Mvc\Model\Manager->_getConnection(Object(Brands: [id] => null, [brend] => null, [naziv] => null), null)
#8Phalcon\Mvc\Model\Manager->getReadConnection(Object(Brands: [id] => null, [brend] => null, [naziv] => null))
#9Phalcon\Mvc\Model->getReadConnection()
#10Phalcon\Mvc\Model\Query->_executeSelect(Array([models] => Array([0] => Brands), [tables] => Array([0] => brend), [columns] => Array([brands] => Array([type] => object, [model] => Brands, [column] => brend, [balias] => brands))), null, null)
#11Phalcon\Mvc\Model\Query->execute()
#12Phalcon\Mvc\Model::find()
/home/fides/engine/controllers/IndexController.php (11)
<?php
 
// Powered by Limit We Are Beyond That
// Using Phalcon FW 
 
class IndexController extends ControllerBase {
    public function initialize() {
      parent::initialize();
    }  
  public function indexAction() {
    $brands   = Brands::find();
    $artikli  = Artikli::find(['limit' => 20, 'offset' => rand(0,100)]);
    $this->view->setVar('brands', $brands);
    $this->view->setVar('artikli', $artikli);
  }
  public function aboutAction() {
    
  }
  public function servicesAction() {
    
  }
  public function brandsAction() {
    $brands = Brands::find(['order'=>'naziv ASC']);
    $this->view->setVar('brands', $brands);
  }
  public function partnersAction() {
    if( $this->request->isPost() ) {
      $this->view->setVar("post", $this->request->getPost());
      if( $this->request->isAjax() ) {
        // Disable the view for AJAX response
        $this->view->disable();
        $data = array();
        $data['s'] = true;
        foreach ($this->request->getPost() as $key => $value) {
          if ($value == '' && (in_array($key, array('name','email','address','message','phone','city','zip','business','country') ) ) ) {
            $data['m'][] = $key;
            $data['s'] = false;
          }
        }
        if ($data['s']) {
          // Handle residential mail  
          $mail = new Mail();
          $mail->send(
            'miskone@gmail.com',
            "Kontakt",
            "contact_partner",
            array(
              "c" => $this->request->getPost()
            )
          );    
        } else {
          // Handle validation errors
          $data['s']      = false;
          $data['l']      = true;
        }
        $response = new \Phalcon\Http\Response();
        $response->setStatusCode( 200, $description );
        $response->setContentType( $contentType, 'UTF-8' );
        $response->setContent( json_encode( $data ) );
        return $response;
      }
    }    
  }
  public function ContactAction() {
    if( $this->request->isPost() ) {
      $this->view->setVar("post", $this->request->getPost());
      if( $this->request->isAjax() ) {
        // Disable the view for AJAX response
        $this->view->disable();
        $data = array();
        $data['s'] = true;
        foreach ($this->request->getPost() as $key => $value) {
          if ($value == '' && (in_array($key, array('name','email','type','message') ) ) ) {
            $data['m'][] = $key;
            $data['s'] = false;
          }
        }
        if ($data['s']) {
          // Handle residential mail  
          $mail = new Mail();
          $mail->send(
            'miskone@gmail.com',
            "Kontakt",
            "contact",
            array(
              "c" => $this->request->getPost()
            )
          );    
        } else {
          // Handle validation errors
          $data['s']      = false;
          $data['l']      = true;
        }
        $response = new \Phalcon\Http\Response();
        $response->setStatusCode( 200, $description );
        $response->setContentType( $contentType, 'UTF-8' );
        $response->setContent( json_encode( $data ) );
        return $response;
      }
    }    
  }
}
#13IndexController->indexAction()
#14Phalcon\Dispatcher->dispatch()
#15Phalcon\Mvc\Application->handle()
/home/fides/public_html/index.php (49)
<?php
 
// Powered by: Limit We are beyond that
// All rights are reserved
 
// Declare namespaces to be used
use Phalcon\Mvc\Application;
use Phalcon\Config;
 
ini_set('display_errors', 1);
$debug = new \Phalcon\Debug();
$debug->listen();
 
// Define Application paths
define('BASE_PATH', realpath('..') . '/');
define('APPLICATION', BASE_PATH . 'engine/');
define('PUBLIC_PATH', BASE_PATH . 'public_html/');
 
$base_dir  = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite
$doc_root  = preg_replace("!{$_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www
$base_url  = preg_replace("!^{$doc_root}!", '', $base_dir); # ex: '' or '/mywebsite'
$protocol  = empty($_SERVER['HTTPS']) ? 'http' : 'https';
$port      = $_SERVER['SERVER_PORT'];
$disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port";
$domain    = $_SERVER['SERVER_NAME'];
$full_url  = "$protocol://{$domain}{$disp_port}{$base_url}"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.
 
define('FULL_URL', $full_url); 
 
 
// Define CMS versions
define('STELLA_VERSION', '0.1');
 
// Read the configuration file
require(APPLICATION . 'bootstrap/config.php');
$config = new Config($settings);
 
// Configure Autoloader
require APPLICATION . 'bootstrap/loader.php';
 
// Load Application Services (Dependency Injection)
require APPLICATION . 'bootstrap/di.php';
 
// Set required headers
header('Content-type: text/html; charset=utf-8');
 
// Handle the request
$application = new Application($di);
$html = $application->handle()->getContent();
//echo $html;
echo preg_replace('/\s+/', ' ', $html);
KeyValue
pageshop.ask
product_id1077
subjectNazovite radi cene: Otvorena ekspanziona posuda
optioncom_virtuemart
Itemid1
vmcchk1
KeyValue
HTTP_HOSTwww.fidesteam.net
HTTP_ACCEPT_ENCODINGx-gzip, gzip, deflate
HTTP_USER_AGENTCCBot/2.0 (http://commoncrawl.org/faq/)
HTTP_ACCEPT_LANGUAGEen-us,en-gb,en;q=0.7,*;q=0.3
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
PATH/sbin:/usr/sbin:/bin:/usr/bin
SERVER_SIGNATURE<address>Apache/2.2.15 (CentOS) Server at www.fidesteam.net Port 80</address>\n
SERVER_SOFTWAREApache/2.2.15 (CentOS)
SERVER_NAMEwww.fidesteam.net
SERVER_ADDR78.46.181.230
SERVER_PORT80
REMOTE_ADDR107.20.107.165
DOCUMENT_ROOT/home/fides/public_html
SERVER_ADMINwebmaster@limit.rs
SCRIPT_FILENAME/home/fides/public_html/index.php
REMOTE_PORT53821
GATEWAY_INTERFACECGI/1.1
SERVER_PROTOCOLHTTP/1.0
REQUEST_METHODGET
QUERY_STRINGpage=shop.ask&product_id=1077&subject=Nazovite+radi+cene%3A+Otvorena+ekspanziona+posuda&option=com_virtuemart&Itemid=1&vmcchk=1&Itemid=1
REQUEST_URI/index.php?page=shop.ask&product_id=1077&subject=Nazovite+radi+cene%3A+Otvorena+ekspanziona+posuda&option=com_virtuemart&Itemid=1&vmcchk=1&Itemid=1
SCRIPT_NAME/index.php
PHP_SELF/index.php
REQUEST_TIME_FLOAT1438385063.091
REQUEST_TIME1438385063
#Path
0/home/fides/public_html/index.php
1/home/fides/engine/bootstrap/config.php
2/home/fides/engine/bootstrap/loader.php
3/home/fides/engine/bootstrap/di.php
4/home/fides/engine/bootstrap/router.php
5/home/fides/engine/plugins/AuthPlugin.php
6/home/fides/engine/controllers/IndexController.php
7/home/fides/engine/controllers/ControllerBase.php
8/home/fides/engine/models/Brands.php
Memory
Usage524288