static function GetConfigOption($pszKey, $pszDefault = null) { switch (func_num_args()) { case 1: $r = GetConfigOption($pszKey); break; default: $r = GetConfigOption($pszKey, $pszDefault); } return $r; }
function TequilaClient($sServer = '', $iTimeout = NULL) { $this->stderr = fopen('php://stderr', 'w'); /* If curl is not found, */ if (!extension_loaded('curl')) { return $this->Error(ERROR_CURL_NOT_LOADED); } /* Initializations. If no parameter given, get info from config file */ if (empty($sServer)) { $sServer = GetConfigOption('sServer'); } if (empty($sServer)) { $sServerUrl = GetConfigOption('sServerUrl'); } $aEtcConfig = $this->LoadEtcConfig(); if (empty($sServer)) { $sServer = $aEtcConfig['sServer']; } if (empty($sServerUrl)) { $sServerUrl = $aEtcConfig['sServerUrl']; } if (empty($sServerUrl) && !empty($sServer)) { $sServerUrl = $sServer . '/cgi-bin/tequila'; } if (empty($iTimeout)) { $iTimeout = GetConfigOption('iTimeout', 86400); } if (empty($logoutUrl)) { $logoutUrl = GetConfigOption('logoutUrl'); } $this->sServer = $sServer; $this->sServerUrl = $sServerUrl; $this->iTimeout = $iTimeout; $this->logoutUrl = $logoutUrl; $this->iCookieLife = COOKIE_LIFE; $this->sCookieName = COOKIE_NAME; }