PHP Classes

File: public/index.php

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  Chronicle  >  public/index.php  >  Download  
File: public/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Chronicle
Append arbitrary data to a storage container
Author: By
Last change:
Date: 3 years ago
Size: 867 bytes
 

Contents

Class file image Download
<?php
if (PHP_SAPI == 'cli-server') {
   
// To help the built-in PHP dev server, check if the request was actually for
    // something which should probably be served as a static file
   
$url = parse_url($_SERVER['REQUEST_URI']);
   
$file = __DIR__ . $url['path'];
    if (
is_file($file)) {
        return
false;
    }
}

require
dirname(__DIR__) . '/cli-autoload.php';

session_start();

// Instantiate the app
$settings = require CHRONICLE_APP_ROOT . '/src/settings.php';
\
ParagonIE\Chronicle\Chronicle::storeSettings($settings);
$app = new \Slim\App($settings);

// Set up dependencies
require CHRONICLE_APP_ROOT . '/src/dependencies.php';
require
CHRONICLE_APP_ROOT . '/src/database.php';

// Register middleware
require CHRONICLE_APP_ROOT . '/src/middleware.php';

// Register routes
require CHRONICLE_APP_ROOT . '/src/routes.php';

// Run app
$app->run();

For more information send a message to info at phpclasses dot org.