<?php $startTime = microtime(true); DEFINE("WB_DA", TRUE); error_reporting(E_ALL); ini_set("display_errors", 1); include "project/init.php"; function __inDevelopement() { return false; } ## __workerBee()->draw(); Application()->start(); echo "<br />" . memory_get_usage() / 1024 . ' ' . (microtime(true) - $startTime);
$cparams = new CL_Params(); $cparams->addParam('--test', 'test')->addParam('--testing', 'test2')->addParam('new', 'test1'); $params->addParam('controller', $cparams)->addParam('--test')->addParam('--version', 'appVersion')->attachContainer($this)->attachHandler('rootHandler')->check($args); echo "\n\n\n\n"; } function rootHandler($params) { print_r($params); } function test1($args) { echo ">>1>> "; print_r($args); } function no_params($args) { echo ">>> nogood \n"; } function appVersion() { echo "\n"; echo " +--------------------------------------------------------+\n"; echo " | Amber PHP Application Framework |\n"; echo " | Version v" . AMBER_VERSION . " |\n"; echo " | Author " . AMBER_AUTHOR . " |\n"; echo " +--------------------------------------------------------+\n\n"; } } Application(); Application()->exec();
<?php require_once __DIR__ . "/../vendor/autoload.php"; require_once __DIR__ . "/../src/Author.php"; require_once __DIR__ . "/../src/Book.php"; $app = new Silex() / Application(); $server = 'mysql:host=localhost;dbname=library'; $username = '******'; $password = '******'; $DB = new PDO($server, $username, $password); use Symfony\Component\HttpFoundation\Request; Request::enableHttpMethodParameterOverride(); $app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views')); $app->get("/", function () { return "home"; }); return $app;