*/
public function createConnection($dsn, array $config, array $options)
{
$username = array_get($config, 'username');
$password = array_get($config, 'password');
return new PDO($dsn, $username, $password, $options);
}
*/
public function createConnection($dsn, array $config, array $options)
{
$username = array_get($config, 'username');
$password = array_get($config, 'password');
return new PDO($dsn, $username, $password, $options);
}
$dsn = $this->getDsn($config);
$options = $this->getOptions($config);
// We need to grab the PDO options that should be used while making the brand
// new connection instance. The PDO options control various aspects of the
// connection's behavior, and some might be specified by the developers.
$connection = $this->createConnection($dsn, $config, $options);
if (isset($config['unix_socket']))
if (isset($config['read'])) {
return $this->createReadWriteConnection($config);
}
return $this->createSingleConnection($config);
}
protected function createSingleConnection(array $config)
{
$pdo = $this->createConnector($config)->connect($config);
return $this->createConnection($config['driver'], $pdo, $config['database'], $config['prefix'], $config);
}
}
public function make(array $config, $name = null)
{
$config = $this->parseConfig($config, $name);
if (isset($config['read'])) {
return $this->createReadWriteConnection($config);
}
return $this->createSingleConnection($config);
}
protected function createSingleConnection(array $config)
if (isset($this->extensions[$name])) {
return call_user_func($this->extensions[$name], $config, $name);
}
$driver = $config['driver'];
if (isset($this->extensions[$driver])) {
return call_user_func($this->extensions[$driver], $config, $name);
}
return $this->factory->make($config, $name);
}
protected function prepare(Connection $connection)
$this->app = $app;
$this->factory = $factory;
}
public function connection($name = null)
{
list($name, $type) = $this->parseConnectionName($name);
if (!isset($this->connections[$name])) {
$connection = $this->makeConnection($name);
$this->setPdoForType($connection, $type);
$this->connections[$name] = $this->prepare($connection);
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return static::$app['db']->connection()->getSchemaBuilder();
}
{
if ($root = static::getFacadeRoot()) {
return get_class($root);
}
}
public static function getFacadeRoot()
{
return static::resolveFacadeInstance(static::getFacadeAccessor());
}
protected static function getFacadeAccessor()
}
public static function setFacadeApplication($app)
{
static::$app = $app;
}
public static function __callStatic($method, $args)
{
$instance = static::getFacadeRoot();
switch (count($args)) {
case 0:
class LangModel extends Eloquent {
protected $table = 'languages';
public static function getLangConfig() {
$out = array();
if (!Schema::hasTable('languages'))
return array('default'=>array('code'=>'ru'), 'languages'=>array('ru'));
class LangModel extends Eloquent {
protected $table = 'languages';
public static function getLangConfig() {
$out = array();
if (!Schema::hasTable('languages'))
return array('default'=>array('code'=>'ru'), 'languages'=>array('ru'));
| Extending Route object with Shop-specific routes
|
*/
$lang = App::getLocale();
$lang_config = LangModel::getLangConfig();
* Bootstrap the application events.
*
* @return void
*/
public function boot() {
$this->package('botnd/shop');
require __DIR__.'/../../helpers.php';
require __DIR__.'/../../routes.php';
require __DIR__.'/../../view_composers.php';
require __DIR__.'/../../events.php';
}
public function boot()
{
if ($this->booted) {
return;
}
array_walk($this->serviceProviders, function ($p) {
$p->boot();
});
$this->bootApplication();
public function boot()
{
if ($this->booted) {
return;
}
array_walk($this->serviceProviders, function ($p) {
$p->boot();
});
$this->bootApplication();
}
return $m['class'] != $class;
});
}
public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
try {
$this->refreshRequest($request = Request::createFromBase($request));
$this->boot();
return $this->dispatch($request);
} catch (\Exception $e) {
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$this->checkRequestForArraySessions($request);
if ($this->sessionConfigured()) {
$session = $this->startSession($request);
$request->setSession($session);
}
$response = $this->app->handle($request, $type, $catch);
if ($this->sessionConfigured()) {
$this->closeSession($session);
public function __construct(HttpKernelInterface $app, CookieJar $cookies)
{
$this->app = $app;
$this->cookies = $cookies;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = $this->app->handle($request, $type, $catch);
foreach ($this->cookies->getQueuedCookies() as $cookie) {
$response->headers->setCookie($cookie);
public function __construct(HttpKernelInterface $app, Encrypter $encrypter)
{
$this->app = $app;
$this->encrypter = $encrypter;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
return $this->encrypt($this->app->handle($this->decrypt($request), $type, $catch));
}
protected function decrypt(Request $request)
public function __construct(HttpKernelInterface $app, array $middlewares)
{
$this->app = $app;
$this->middlewares = $middlewares;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
return $this->app->handle($request, $type, $catch);
}
public function terminate(Request $request, Response $response)
if ($this->isBooted()) {
$this->fireAppCallbacks(array($callback));
}
}
public function run(SymfonyRequest $request = null)
{
$request = $request ?: $this['request'];
$response = with($stack = $this->getStackedClient())->handle($request);
$response->send();
$stack->terminate($request, $response);
| Once we have the application, we can simply call the run method,
| which will execute the request and send the response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have whipped up for them.
|
*/
SassCompiler::run("scss/", "css/",'scss_formatter');
$app->run();