true )); //$oConfig->merge(new Zend_Config_Ini(APPLICATION_PATH . '/config/environment.ini', APPLICATION_ENV, array( 'allowModifications' => true ))); //TODO: Do this in the bootstrap. For bonus points. require 'Zend/Registry.php'; Zend_Registry::set('config', $oConfig); /** Zend_Application */ require 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, $oConfig ); $application->getBootstrap()->bootstrap(); // set hotel en taal $oSession = new Zend_Session_Namespace("guestcompass"); if(empty($oSession->hotel)){ $Hotels = new Application_Model_Hotels(); $hotel = $Hotels->getBy("webapp_url" , $_SERVER['HTTP_HOST']); if(empty($hotel)){ $request->setModuleName('default'); $request->setControllerName('error'); $request->setActionName('error'); $this->getResponse()->setHttpResponseCode(500); // Set up the error handler $error = new Zend_Controller_Plugin_ErrorHandler(); $error->type = Zend_Controller_Plugin_ErrorHandler::EXCEPTION_OTHER; $error->request = clone($request); $error->exception = new Exception('No hotel found with this url ('.$_SERVER['HTTP_HOST'].')'); $request->setParam('error_handler', $error); Zend_Layout::getMvcInstance()->setLayout('error'); return; }else{ // als opticen leeg is betetekend dat er nog geen domain is aangemaakt voor die gebruiker en moet hij naar een 404 / 500 of zo // zou ook mooi zijn om de data in een sessie te zeten of zo $oSession->hotel = array_shift($hotel); } } header("Content-Type: text/plain"); echo '{ "name": "'.$oSession->hotel['name'].'", "short_name": "'.$oSession->hotel['name'].'", "gcm_sender_id": "'.$oSession->hotel['google_project_nr'].'", "display": "standalone", "gcm_user_visible_only": true }'; ?>