public function setMode($mode)
{
$this->mode = $mode;
$this->updateBlockSize();
}
protected function updateBlockSize()
{
$this->block = mcrypt_get_iv_size($this->cipher, $this->mode);
}
}
public function setMode($mode)
{
$this->mode = $mode;
$this->updateBlockSize();
}
protected function updateBlockSize()
{
$this->block = mcrypt_get_iv_size($this->cipher, $this->mode);
}
}
public function setKey($key)
{
$this->key = $key;
}
public function setCipher($cipher)
{
$this->cipher = $cipher;
$this->updateBlockSize();
}
public function setMode($mode)
class EncryptionServiceProvider extends ServiceProvider
{
public function register()
{
$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']);
}
return $encrypter;
$this->bind($abstract, $concrete, true);
}
public function share(Closure $closure)
{
return function ($container) use($closure) {
static $object;
if (is_null($object)) {
$object = $closure($container);
}
return $object;
protected function missingLeadingSlash($abstract)
{
return is_string($abstract) && strpos($abstract, '\\') !== 0;
}
public function build($concrete, $parameters = array())
{
if ($concrete instanceof Closure) {
return $concrete($this, $parameters);
}
$reflector = new ReflectionClass($concrete);
{
$abstract = $this->getAlias($abstract);
if (isset($this->instances[$abstract])) {
return $this->instances[$abstract];
}
$concrete = $this->getConcrete($abstract);
if ($this->isBuildable($concrete, $abstract)) {
$object = $this->build($concrete, $parameters);
} else {
$object = $this->make($concrete, $parameters);
}
public function make($abstract, $parameters = array())
{
$abstract = $this->getAlias($abstract);
if (isset($this->deferredServices[$abstract])) {
$this->loadDeferredProvider($abstract);
}
return parent::make($abstract, $parameters);
}
public function bound($abstract)
}
public function offsetExists($key)
{
return isset($this->bindings[$key]);
}
public function offsetGet($key)
{
return $this->make($key);
}
public function offsetSet($key, $value)
$response = with($stack = $this->getStackedClient())->handle($request);
$response->send();
$stack->terminate($request, $response);
}
protected function getStackedClient()
{
$sessionReject = $this->bound('session.reject') ? $this['session.reject'] : null;
$client = (new \Stack\Builder())->push('Illuminate\\Cookie\\Guard', $this['encrypter'])->push('Illuminate\\Cookie\\Queue', $this['cookie'])->push('Illuminate\\Session\\Middleware', $this['session'], $sessionReject);
$this->mergeCustomMiddlewares($client);
return $client->resolve($this);
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.
|
*/
$app->run();