Ignore:
Timestamp:
Aug 28, 2015, 3:29:08 PM (11 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
master
Children:
b858e6f
Parents:
851179e
Message:
  • Rewrites are now working
    • Setup is now accessable via Slim too
    • Added 404 template to Slim app
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/webservice/htdocs/SiWeather/Webservice/WebserviceConfig.php

    r851179e r1e37648  
    2424
    2525        function __construct(){
    26                 require(__DIR__ ."/../../config/config.php");
     26                require(__DIR__ ."/../../../config/config.php");
    2727                $this->_config = $config;
    2828                $this->loadAdditionalConfiguration();
    … …  
    3535        private function loadAdditionalConfiguration(){
    3636                $this->_config["dataDirectory"] = "data";
     37               
     38                require(__DIR__ ."/../../inc/internalconfig.php");
     39                foreach(array_keys($internalconfig) as $key){
     40                        if(array_key_exists($key, $this->_config)){
     41                                error_log("Internal config entry ". $key ." already exists --> Keeping existing value and discard internal config value");
     42                        }
     43                        else{
     44                                $this->_config[$key] = $internalconfig[$key];
     45                        }
     46                }
    3747        }
    3848
    … …  
    4757                        return $this->dataDirectory();
    4858                }
     59                if($key == "webserviceBaseUrl"){
     60//                      error_log("Use dataDirectory() function to access this value");
     61                        return $this->webserviceBaseUrl();
     62                }
    4963               
    5064                return $this->_config[$key];
    … …  
    5266
    5367        public function dataDirectory(){
    54                 return __DIR__ ."/../../". $this->_config["dataDirectory"];
     68                return __DIR__ ."/../../../". $this->_config["dataDirectory"];
     69        }
     70       
     71        public function webserviceBaseUrl(){
     72                $baseUrl = $this->_config["webserviceBaseUrl"];
     73                if(substr($baseUrl, strlen($baseUrl) - 1, 1) != "/"){
     74                        $baseUrl .= "/";
     75                }
     76                return $baseUrl;
    5577        }
    5678
Note: See TracChangeset for help on using the changeset viewer.