Example #1
0
 /**
  * @throws \Exception
  */
 function __construct()
 {
     $this->domain = Headers::get('Host');
     if (!class_exists('Memcached') && Globals::get('MongularCache')) {
         $error = 'Mongular cache turned on but memcached does not exist.';
         throw new \Exception($error);
     }
 }
Example #2
0
 /**
  * @throws \Exception
  */
 public function __construct()
 {
     if (isset($_GET['q'])) {
         $parameters = explode('/', $_GET['q']);
         $this->request = Classes::getControllerRoute(array_shift($parameters));
         if (!$this->request) {
             throw new \Exception('Mongular: Request not valid.');
         }
         $this->values = $parameters;
         $this->query_parameters = Headers::get('QueryParameters');
     } else {
         throw new \Exception('Mongular: No valid parameters passed.');
     }
 }