예제 #1
0
 public function __construct(Language $language = null, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     if ($language === null) {
         $shortName = false;
         if (isset($_GET['language']) && $this->languageExists($_GET['language'])) {
             $shortName = $_GET['language'];
         } elseif (isset($_SESSION['language']) && $this->languageExists($_SESSION['language'])) {
             $shortName = $_SESSION['language'];
         } elseif (isset($_COOKIE['language']) && $this->languageExists($_COOKIE['language'])) {
             $shortName = $_COOKIE['language'];
         }
         if ($shortName !== false) {
             $language = Language::getLanguage($shortName);
         } else {
             $language = $this->getDefaultLanguage();
         }
     }
     if ($language instanceof Language) {
         $this->language = $language;
         $this->setLanguage($language);
     } else {
         throw new InvalidArgumentException("Argument should be instanse of Language");
     }
 }
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     if (isset($config->logMinutes)) {
         $this->logMinutes = $config->logMinutes;
     }
 }
예제 #3
0
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     if (isset($config->sessionClearTimeout)) {
         $this->sessionClearTimeout = $config->sessionClearTimeout;
     }
 }
예제 #4
0
 public function __construct($dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->remoteIp = $_SERVER["REMOTE_ADDR"];
     if (empty($this->remoteIp) and !Cgi::getMode()) {
         throw new RuntimeException("Could not determine client ip address.");
     }
 }
예제 #5
0
 public function __construct(Host $host, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     if (empty($host->host)) {
         throw new InvalidArgumentException("\$host have to be non empty Host object");
     }
     $this->host = $host;
 }
예제 #6
0
 public function __construct($lang_id = null, $cacheMinutes = null)
 {
     parent::__construct();
     if ($lang_id !== null) {
         if (!is_numeric($lang_id)) {
             throw new InvalidIntegerArgumentException("lang_id argument should be an integer.");
         }
         $this->query->exec("SELECT * FROM `" . Tbl::get('TBL_LANGUAGES') . "` WHERE `id` = '{$lang_id}'", $cacheMinutes);
         if ($this->query->countRecords()) {
             $data = $this->query->fetchRecord();
             static::setData($data, $this);
         } else {
             throw new RuntimeException("Wrong languge id is given. No record with id: {$lang_id} in table " . Tbl::get('TBL_LANGUAGES'));
         }
     }
 }
예제 #7
0
 public function __construct($lang_id = null, $cacheMinutes = null)
 {
     parent::__construct();
     if ($lang_id !== null) {
         if (!is_numeric($lang_id)) {
             throw new InvalidIntegerArgumentException("lang_id argument should be an integer.");
         }
         $qb = new QueryBuilder();
         $qb->select(new Field('*'))->from(Tbl::get('TBL_LANGUAGES'))->where($qb->expr()->equal(new Field('id'), $lang_id));
         $this->query->exec($qb->getSQL(), $cacheMinutes);
         if ($this->query->countRecords()) {
             $data = $this->query->fetchRecord();
             static::setData($data, $this);
         } else {
             throw new RuntimeException("Wrong languge id is given. No record with id: {$lang_id} in table " . Tbl::get('TBL_LANGUAGES'));
         }
     }
 }
예제 #8
0
 public function __construct(Host $host, Language $language, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->host = $host;
     $this->language = $language;
 }
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->config = $config;
 }
예제 #10
0
 public function __construct($dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
 }
예제 #11
0
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->config = $config;
     $this->um = Reg::get(ConfigManager::getConfig("Users", "Users")->Objects->UserManager);
 }
 public function __construct(UserManagement $um, Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->um = $um;
     $this->config = $config;
 }
 /**
  * Class contructor
  * @param var $usr
  * @param var $sessionVar
  */
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->authYubikey = new Yubikey($config->yubico_id, $config->yubico_key);
 }
 public function __construct($tableName, $dbConnection = null)
 {
     parent::__construct($dbConnection);
     $this->tableName = $tableName;
 }