Example #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testGetEmptyValues()
 {
     $values = $this->object->getValues();
     $this->object->delete('1 = 1');
     $this->assertInternalType('array', $this->object->getValues());
     //restore data
     foreach ($values as $value) {
         $this->object->insert($value);
     }
 }
Example #2
0
{
    $str .= "<b>Error code</b>: " . $obj->code . "<br>\n";
    $str .= "<b>Error message</b>: " . $obj->message . "<br>\n";
    $str .= "<b>Debug string</b>: " . $obj->userinfo . "<br>\n\n";
    echo $str;
}
/*
 * reads config file
 */
$blocks = array();
$data = array();
$conf = new Config('IniFile');
$conf->parseInput('rubbercity.ini');
$blocks = $conf->getBlocks("/");
foreach ($blocks as $block) {
    $cfg[$block] = $conf->getValues("/" . $block);
}
/*
 * Sets the language according to browser settings
 */
$langSupported = array("de" => true, "en" => true);
define("LC_LANG", HTTP::negotiateLanguage($langSupported, 'en'));
$langSelected = 'rc_' . LC_LANG;
include_once $cfg['path']['i18n'] . LC_LANG . ".php";
$lang = new $langSelected();
$heute = date("Ymd", time());
// current date
/*
 * Template
 */
function tpl_translate($args)
 /**
  * reads config file
  */
 function parseConfig()
 {
     require_once 'Config/Config.php';
     $blocks = array();
     $data = array();
     $conf = new Config('IniFile');
     $conf->parseInput('rubbercity.ini');
     $blocks = $conf->getBlocks("/");
     foreach ($blocks as $block) {
         $cfg[$block] = $conf->getValues("/" . $block);
     }
     $this->cfg = $cfg;
 }
Example #4
0
//   -------------------------------------------------------------------------------
session_start();
error_reporting(0);
//error_reporting(E_ALL); // setting for development edition - see all error messages
$include_path = realpath(dirname(__FILE__));
include_once realpath($include_path . '/spGzip.php');
include_once realpath($include_path . '/class.pTemplate.php');
include_once realpath($include_path . '/vhcs2-db-keys.php');
include_once realpath($include_path . '/vhcs-config.php');
$cfg_obj = new Config("/etc/vhcs2/vhcs2.conf");
if ($cfg_obj->status == "err") {
    /* cannot open vhcs.conf file - we must show warning */
    print "<center><b><font color=red>Can not open the vhcs2.conf config file !<br><br>Pleas contact your system administrator</font></b></center>";
    die;
}
$cfg = $cfg_obj->getValues();
$cfg['DB_TYPE'] = $cfg['DATABASE_TYPE'];
$cfg['DB_HOST'] = $cfg['DATABASE_HOST'];
$cfg['DB_USER'] = $cfg['DATABASE_USER'];
$cfg['DB_PASS'] = '';
if ($cfg['DATABASE_PASSWORD'] != '') {
    /* decrypt database password */
    $cfg['DB_PASS'] = decrypt_db_password($cfg['DATABASE_PASSWORD']);
}
$cfg['DB_NAME'] = $cfg['DATABASE_NAME'];
$cfg['SESSION_TIMEOUT'] = 300 * 60;
$cfg['ITEM_ADD_STATUS'] = 'toadd';
$cfg['ITEM_OK_STATUS'] = 'ok';
$cfg['ITEM_CHANGE_STATUS'] = 'change';
$cfg['ITEM_DELETE_STATUS'] = 'delete';
$cfg['ITEM_DISABLED_STATUS'] = 'disabled';