Ejemplo n.º 1
0
 /**
  * Returns variable provided to the script via URL query ($_GET).
  * If no key is passed, returns the entire array.
  * @param  string key
  * @param  mixed  default value
  * @return mixed
  */
 public function getQuery($key = NULL, $default = NULL)
 {
     if (func_num_args() === 0) {
         return $this->url->getQueryParameters();
     } else {
         return $this->url->getQueryParameter($key, $default);
     }
 }
Ejemplo n.º 2
0
 /**
  * @param bool $hasDb
  * @param Provider $provider
  * @param Request $request
  * @param Response $response
  */
 public function __construct($hasDb, Provider $provider, Request $request, Response $response)
 {
     $this->provider = $provider;
     $this->url = $request->getUrl();
     $this->hasDb = $hasDb;
     $this->request = $request;
     if ($this->url->getQueryParameter('debug-import-parameters')) {
         $provider->import();
         $this->redirectBack();
     }
     if ($this->url->getQueryParameter('debug-parameters-cache')) {
         $provider->cleanParametersCache();
         $this->redirectBack();
     }
 }