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_LANGS = 21;
const SYS_CONFIG_DEFAULT_LANG = 22; const SYS_CONFIG_DEFAULT_LANG = 22;
const SYS_CRON_LOG2SQLITE_PATH = 30;
const SYS_SAI_CONFIG_BASEURL = 50; const SYS_SAI_CONFIG_BASEURL = 50;
const SYS_SAI_CONFIG_NAVIMG = 51; const SYS_SAI_CONFIG_NAVIMG = 51;
const SYS_SAI_CONFIG_TITLE = 52; const SYS_SAI_CONFIG_TITLE = 52;

View File

@ -10,9 +10,9 @@ class cron_log2sqlite extends \SYSTEM\CRON\cronjob{
$oldest['month'] >= $now_month){ $oldest['month'] >= $now_month){
return cronstatus::CRON_STATUS_SUCCESFULLY;} 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 //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 //create table
$con->query('CREATE TABLE IF NOT EXISTS `system_log` ('. $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,'. ' `thrown` BIT(1) NOT NULL,'.
' PRIMARY KEY (`ID`)'.');'); ' PRIMARY KEY (`ID`)'.');');
//write data //write data as trasaction
$con->exec('begin transaction'); $con->exec('begin transaction');
$res = \SYSTEM\DBD\SYS_LOG_MONTH::QQ(array($oldest['month'],$oldest['year'])); $res = \SYSTEM\DBD\SYS_LOG_MONTH::QQ(array($oldest['month'],$oldest['year']));
$i = 0; $i = 0;

View File

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

View File

@ -2,9 +2,9 @@
namespace SYSTEM\DB; namespace SYSTEM\DB;
class DBInfoSQLite extends \SYSTEM\DB\DBInfo { 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_database = $database;
$this->m_user = $permissions; $this->m_user = $user;
$this->m_password = $password; $this->m_password = $password;
$this->m_host = $host; $this->m_host = $host;
$this->m_port = $port; $this->m_port = $port;