config option to save sqlite export

This commit is contained in:
Ulf Gebhardt 2014-11-28 01:05:15 +01:00
parent f2f3c6b839
commit ec85264b3b
4 changed files with 8 additions and 10 deletions

View File

@ -24,6 +24,8 @@ class config_ids {
const SYS_CONFIG_LANGS = 21;
const SYS_CONFIG_DEFAULT_LANG = 22;
const SYS_CRON_LOG2SQLITE_PATH = 30;
const SYS_SAI_CONFIG_BASEURL = 50;
const SYS_SAI_CONFIG_NAVIMG = 51;
const SYS_SAI_CONFIG_TITLE = 52;

View File

@ -10,9 +10,9 @@ class cron_log2sqlite extends \SYSTEM\CRON\cronjob{
$oldest['month'] >= $now_month){
return cronstatus::CRON_STATUS_SUCCESFULLY;}
$filename = '/home/web/webdir/mojotrollz/mojotrollz/files/log/'.$oldest['year'].'.'.$oldest['month'].'.db';
$filename = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$oldest['year'].'.'.$oldest['month'].'.db';
//extract whole month to file
$con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite($filename,0666));
$con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite($filename));
//create table
$con->query('CREATE TABLE IF NOT EXISTS `system_log` ('.
@ -36,7 +36,7 @@ class cron_log2sqlite extends \SYSTEM\CRON\cronjob{
' `thrown` BIT(1) NOT NULL,'.
' PRIMARY KEY (`ID`)'.');');
//write data
//write data as trasaction
$con->exec('begin transaction');
$res = \SYSTEM\DBD\SYS_LOG_MONTH::QQ(array($oldest['month'],$oldest['year']));
$i = 0;

View File

@ -48,10 +48,6 @@ class ConnectionSQLite extends ConnectionAbstr {
}
public function exec($query){
$result = false;
$result = $this->connection->exec($query);
return $result;
return $this->connection->exec($query);
}
}

View File

@ -2,9 +2,9 @@
namespace SYSTEM\DB;
class DBInfoSQLite extends \SYSTEM\DB\DBInfo {
public function __construct($database , $permissions , $password = null, $host = null, $port = null){
public function __construct($database , $user = null , $password = null, $host = null, $port = null){
$this->m_database = $database;
$this->m_user = $permissions;
$this->m_user = $user;
$this->m_password = $password;
$this->m_host = $host;
$this->m_port = $port;