Редакция 313 |
Редакция 315 |
К новейшей редакции |
Авторство |
Сравнить с предыдущей |
Последнее изменение |
Открыть журнал
| Скачать
| RSS
<?php
/**
*
* Codename: ant-ng - generator of sources.list for Debian and
* distributives, based on Debian
* http://alex-w.org.ru/p/antng/
*
* Copyright (c) 2009 Alexander Wolf
* Dual licensed under the MIT and GNU LGPL licenses.
* http://alex-w.org.ru/p/antng/license
*
*/
class Core
{
protected $db = NULL;
protected $prefix = NULL;
protected $secure = NULL;
function __construct
($database, $prefix, $secure) {
$this->db = $database;
$this->prefix = $prefix;
$this->secure = $secure;
}
function getOption
($attr) {
$result = array();
$query = "SELECT optvalue FROM ".$this->prefix."settings WHERE opt='".$this->secure->checkInt($attr)."'";
$rq =& $this->db->query($query);
if ($rq->numRows()!=0) {
$rq->fetchInto($element);
$result["ERR"] = 0;
$result["OptValue"] = $element["optvalue"];
} else {
$result["ERR"] = 1;
$result["ERRINFO"] = "Empty result";
}
return $result;
}
}
?>