<?php define('ROOT_PATH', __DIR__); $autoloader = (require_once ROOT_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); $engine = \Sifoni\Engine::getInstance()->init()->bootstrap(array('path.root' => ROOT_PATH, 'autoloader' => $autoloader)); return $engine;
<?php $app = \Sifoni\Engine::getInstance()->getApp(); $app->register(new Cocur\Slugify\Bridge\Silex\SlugifyServiceProvider()); // Hook anything you want :)
<?php namespace Sifoni\Model; use Illuminate\Database\Eloquent\Model; use Sifoni\Engine; // Enable Eloquent $app = Engine::getInstance()->getApp(); $app['capsule.eloquent'] = true; $app['capsule']->bootEloquent(); $app['capsule']->setAsGlobal(); $app['db'] = DB::connection(); /* * Base Model extends Eloquent ORM */ class Base extends Model { }
public function __construct() { $this->app = $app = Engine::getInstance()->getApp(); $this->request = $app['request']; $this->response = new Response(null, Response::HTTP_OK, array()); }
function engine() { return \Sifoni\Engine::getInstance(); }
<?php define('ROOT_PATH', __DIR__); $autoloader = (require_once ROOT_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); require_once ROOT_PATH . DIRECTORY_SEPARATOR . 'helpers.php'; $dotenv = new Dotenv\Dotenv(__DIR__); $dotenv->load(); $engine = \Sifoni\Engine::getInstance()->init()->bootstrap(array('app.vendor_name' => env('APP_VENDOR_NAME', 'App'), 'timezone' => env('TIMEZONE', 'UTC'), 'debug' => env('DEBUG', true), 'web_profiler' => env('WEB_PROFILER', true), 'enabled_http_fragment' => true, 'enabled_http_cache' => false, 'enabled_twig' => true, 'enabled_session' => true, 'enabled_capsule' => true, 'enabled_csrf' => true, 'enabled_asset' => true, 'path.root' => ROOT_PATH, 'autoloader' => $autoloader)); return $engine;