PHP Classes

File: public/index.php

Recommend this page to a friend!
  Classes of Stefan Ninic   PHP Twitter Clone   public/index.php   Download  
File: public/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Twitter Clone
Social network application similar to Twitter
Author: By
Last change:
Date: 1 year ago
Size: 985 bytes
 

Contents

Class file image Download
<?php
use Phalcon\Di\FactoryDefault;

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.
     */
   
$di = new FactoryDefault();

   
/**
     * Handle routes
     */
   
include APP_PATH . '/config/router.php';

   
/**
     * Read services
     */
   
include APP_PATH . '/config/services.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 \Phalcon\Mvc\Application($di);

    echo
str_replace(["\n","\r","\t"], '', $application->handle()->getContent());

} catch (\
Exception $e) {
    echo
$e->getMessage() . '<br>';
    echo
'<pre>' . $e->getTraceAsString() . '</pre>';
}