/**
* Update the block size for the current cipher and mode.
*
* @return void
*/
protected function updateBlockSize()
{
$this->block = mcrypt_get_iv_size($this->cipher, $this->mode);
}
/**
* Update the block size for the current cipher and mode.
*
* @return void
*/
protected function updateBlockSize()
{
$this->block = mcrypt_get_iv_size($this->cipher, $this->mode);
}
* @param string $cipher
* @return void
*/
public function setCipher($cipher)
{
$this->cipher = $cipher;
$this->updateBlockSize();
}
{
$this->app->bindShared('encrypter', function($app)
{
$encrypter = new Encrypter($app['config']['app.key']);
if ($app['config']->has('app.cipher'))
{
$encrypter->setCipher($app['config']['app.cipher']);
}
// We'll simply declare a static variable within the Closures and if it has
// not been set we will execute the given Closures to resolve this value
// and return it back to these consumers of the method as an instance.
static $object;
if (is_null($object))
{
$object = $closure($container);
}
public function build($concrete, $parameters = array())
{
// If the concrete type is actually a Closure, we will just execute it and
// hand back the results of the functions, which allows functions to be
// used as resolvers for more fine-tuned resolution of these objects.
if ($concrete instanceof Closure)
{
return $concrete($this, $parameters);
}
$concrete = $this->getConcrete($abstract);
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencies recursively until all have gotten resolved.
if ($this->isBuildable($concrete, $abstract))
{
$object = $this->build($concrete, $parameters);
}
else
$abstract = $this->getAlias($abstract);
if (isset($this->deferredServices[$abstract]))
{
$this->loadDeferredProvider($abstract);
}
return parent::make($abstract, $parameters);
}
* Get the value at a given offset.
*
* @param string $key
* @return mixed
*/
public function offsetGet($key)
{
return $this->make($key);
}
* @return \Symfony\Component\HttpKernel\HttpKernelInterface
*/
protected function getStackedClient()
{
$sessionReject = $this->bound('session.reject') ? $this['session.reject'] : null;
$client = (new Builder)
->push('Illuminate\Cookie\Guard', $this['encrypter'])
->push('Illuminate\Cookie\Queue', $this['cookie'])
->push('Illuminate\Session\Middleware', $this['session'], $sessionReject);
* @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();