protected function getUrl() { if (Config::getInstance()->get('useLocalDataMockup')) { return $this->sLocalMockup; } else { return $this->sUrl . '&APPID=' . Config::getInstance()->get('apiKey'); } }
public static function formatLink(array $aParams, $sAmp = true, $bOnClick = false) { $sRetVal = ''; foreach ($aParams as $sKey => $sValue) { $sRetVal .= $sKey . '/' . $sValue; } $sRetVal = \General\Config::getInstance()->get('baseUrl') . $sRetVal; return $sRetVal; }
/** * Set environmental variables */ public static function set() { ini_set('date.timezone', 'Europe/Warsaw'); ini_set('date.default_latitude', '31.7667'); ini_set('date.default_longitude', '35.2333'); ini_set('date.sunrise_zenith', '90.583333'); ini_set('date.sunset_zenith', '90.583333'); date_default_timezone_set("Europe/Warsaw"); mb_internal_encoding("UTF-8"); setlocale(LC_ALL, 'en_US'); /* * Set caching configuration */ PhpCache::$sDefaultMechanism = Config::getInstance()->get('cacheMethod'); Memcached::$host = Config::getInstance()->get('memcachedIP'); Memcached::$port = Config::getInstance()->get('memcachedPort'); Controller::setDefaultLanguage('pl'); }
private static function create() { if (empty(self::$cacheInstance)) { $sCachingMethod = \General\Config::getInstance()->get('cacheMethod'); if ($sCachingMethod === 'apc' && !(extension_loaded('apc') && ini_get('apc.enabled'))) { $sCachingMethod = 'Mem'; } switch ($sCachingMethod) { case 'Apc': self::$cacheInstance = Apc::getInstance(); break; case 'Memcached': self::$cacheInstance = Memcached::getInstance(); break; default: self::$cacheInstance = Variable::getInstance(); break; } } }
public function __construct() { $this->sUrl = 'http://api.openweathermap.org/data/2.5/forecast/daily?q=' . Config::getInstance()->get('cityName') . '&cnt=9&mode=json&units=metric'; }
public function __construct() { $this->sUrl = 'http://api.openweathermap.org/data/2.5/weather?q=' . \General\Config::getInstance()->get('cityName') . '&mode=json&units=metric'; }
public function __construct() { $this->sUrl = 'http://api.openweathermap.org/data/2.5/history/city?id=' . \General\Config::getInstance()->get('cityId') . '&type=hour&units=metric&start=' . (time() - 14 * 86400) . '&end=' . time(); }