*/
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);
}
// First we'll create the basic DSN and connection instance connecting to the
// using the configuration option specified by the developer. We will also
// set the default character set on the connections to UTF-8 by default.
$dsn = $this->getDsn($config);
$options = $this->getOptions($config);
$connection = $this->createConnection($dsn, $config, $options);
$charset = $config['charset'];
* Create a single database connection instance.
*
* @param array $config
* @return \Illuminate\Database\Connection
*/
protected function createSingleConnection(array $config)
{
$pdo = $this->createConnector($config)->connect($config);
return $this->createConnection($config['driver'], $pdo, $config['database'], $config['prefix'], $config);
$config = $this->parseConfig($config, $name);
if (isset($config['read']))
{
return $this->createReadWriteConnection($config);
}
return $this->createSingleConnection($config);
}
// and will call the Closure if so, which allows us to have a more generic
// resolver for the drivers themselves which applies to all connections.
if (isset($this->extensions[$driver]))
{
return call_user_func($this->extensions[$driver], $config, $name);
}
return $this->factory->make($config, $name);
}
list($name, $type) = $this->parseConnectionName($name);
// If we haven't created this connection, we'll create it based on the config
// provided in the application. Once we've created the connections we will
// set the "fetch mode" for PDO which determines the query return types.
if ( ! isset($this->connections[$name]))
{
$connection = $this->makeConnection($name);
$this->setPdoForType($connection, $type);
*
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
return call_user_func_array(array($this->connection(), $method), $parameters);
}
switch (count($args))
{
case 0:
return $instance->$method();
case 1:
return $instance->$method($args[0]);
case 2:
<?php
class Language {
public static function multi(){
// return Cache::remember('LANG_MULTI',60,function(){
return DB::table('jezik')->where('aktivan',1)->count() > 1;
// });
}
public static function segment_offset(){
Route::post('/b2b/registration',array('as'=>'b2b.registration.store','uses'=>'B2bController@registrationStore'));
Route::get('/b2b/zaboravljena-lozinka',array('as'=>'b2b.forgot_password','uses'=>'B2bController@forgotPassword'));
Route::post('/b2b/zaboravljena-lozinka',array('as'=>'b2b.forgot_password_post','uses'=>'B2bController@forgotPasswordPost'));
Route::get('/b2b/login','B2bController@login');
Route::post('/b2b/login/store',array('as'=>'b2b.login.store', 'uses'=>'B2bController@loginStore'));
//B2B
Route::group(array('prefix'=>'b2b','before'=>'b2b'),function (){
$shop_filter = Language::multi() ? array('prefix'=>'{lang}','before'=>'lang') : array('before'=>'lang');
Route::group($shop_filter,function (){
public function group(array $attributes, Closure $callback)
{
$this->updateGroupStack($attributes);
// Once we have updated the group stack, we will execute the user Closure and
// merge in the groups attributes when the route is created. After we have
// run the callback, we will pop the attributes off of this group stack.
call_user_func($callback, $this);
array_pop($this->groupStack);
case 0:
return $instance->$method();
case 1:
return $instance->$method($args[0]);
case 2:
return $instance->$method($args[0], $args[1]);
case 3:
Route::get('/ponuda/{ponuda_id}', 'B2bDokumentiController@ponuda');
Route::post('/ponuda-post', 'B2bDokumentiController@ponuda_post');
Route::get('/ponuda-stavka/{ponuda_stavka_id}/delete', 'B2bDokumentiController@ponuda_stavka_delete');
Route::get('/ponuda/{ponuda_id}/delete', 'B2bDokumentiController@ponuda_delete');
Route::post('/ponuda-stavka-save', 'B2bDokumentiController@ponuda_stavka_save');
});
});
});
///////////////////////////// DOKUMENTI ///////////////////////////////////////////////
| just to keep the file a little cleaner. We'll go ahead and load in
| all of the routes now and return the application to the callers.
|
*/
$routes = $app['path'].'/routes.php';
if (file_exists($routes)) require $routes;
});
* @param array $callbacks
* @return void
*/
protected function fireAppCallbacks(array $callbacks)
{
foreach ($callbacks as $callback)
{
call_user_func($callback, $this);
}
}
// Once the application has booted we will also fire some "booted" callbacks
// for any listeners that need to do work after this initial booting gets
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
}
*/
public function boot()
{
if ($this->booted) return;
array_walk($this->serviceProviders, function($p) { $p->boot(); });
$this->bootApplication();
}
*/
public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
try
{
$this->refreshRequest($request = Request::createFromBase($request));
$this->boot();
return $this->dispatch($request);
if ($this->sessionConfigured())
{
$session = $this->startSession($request);
$request->setSession($session);
}
$response = $this->app->handle($request, $type, $catch);
// Again, if the session has been configured we will need to close out the session
* @param \Symfony\Component\HttpFoundation\Request $request
* @param int $type
* @param bool $catch
* @return \Symfony\Component\HttpFoundation\Response
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = $this->app->handle($request, $type, $catch);
foreach ($this->cookies->getQueuedCookies() as $cookie)
* @param \Symfony\Component\HttpFoundation\Request $request
* @param int $type
* @param bool $catch
* @return \Symfony\Component\HttpFoundation\Response
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
return $this->encrypt($this->app->handle($this->decrypt($request), $type, $catch));
}
{
$this->app = $app;
$this->middlewares = $middlewares;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
return $this->app->handle($request, $type, $catch);
}
* @param \Symfony\Component\HttpFoundation\Request $request
* @return void
*/
public function run(SymfonyRequest $request = null)
{
$request = $request ?: $this['request'];
$response = with($stack = $this->getStackedClient())->handle($request);
$response->send();
| 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.
|
*/
$app->run();