mirror of
https://github.com/mbirth/tcl_update_db.git
synced 2024-12-25 12:04:07 +00:00
Moved helper scripts to bin/ dir.
This commit is contained in:
parent
9d3ad675ef
commit
f37b98cbee
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
/data/
|
||||
/config.ini
|
||||
/otadb.db3
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
$bkup_dir = __DIR__ . '/data/';
|
||||
$bkup_dir = __DIR__ . '/../data/';
|
||||
|
||||
$file_list = glob($bkup_dir . '*.xml');
|
||||
|
5
bin/get_data.sh
Executable file
5
bin/get_data.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
MYDIR=$(dirname "$(readlink -f "$0")")
|
||||
. "${MYDIR}/../config.ini"
|
||||
rsync -av "${SYNC_REMOTE_DIR}/data/*" "${MYDIR}/../data/"
|
||||
|
3
bin/initdb.sh
Executable file
3
bin/initdb.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
MYDIR=$(dirname "$(readlink -f "$0")")
|
||||
sqlite3 "${MYDIR}/../otadb.db3" < "${MYDIR}/../sql/dbschema.sql"
|
@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/lib/autoloader.php';
|
||||
require_once __DIR__ . '/../lib/autoloader.php';
|
||||
|
||||
use \TclUpdates\GotuObject;
|
||||
use \TclUpdates\XmlParser;
|
||||
use \TclUpdates\SQLiteWriter;
|
||||
|
||||
$bkup_dir = __DIR__ . '/data/';
|
||||
$bkup_dir = __DIR__ . '/../data/';
|
||||
|
||||
$file_list = glob($bkup_dir . '*.xml');
|
||||
$sqlw = new SQLiteWriter();
|
5
bin/put_data.sh
Executable file
5
bin/put_data.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
MYDIR=$(dirname "$(readlink -f "$0")")
|
||||
. "${MYDIR}/../config.ini"
|
||||
rsync -av "${MYDIR}/../data" "${SYNC_REMOTE_DIR}/"
|
||||
|
4
bin/put_db.sh
Executable file
4
bin/put_db.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "${MYDIR}/../config.ini"
|
||||
rsync -av "${MYDIR}/../otadb.db3" "${SYNC_REMOTE_DIR}/"
|
||||
|
2
config.ini.example
Executable file
2
config.ini.example
Executable file
@ -0,0 +1,2 @@
|
||||
SYNC_REMOTE_DIR=myhost.example.com:/var/www/htdocs/
|
||||
NOTIFY_WEBHOOK=https://discordapp.com/api/webhooks/123456789012345678/aZZbGdefRghFTijgg6klmnXoIp--3qrsPD5L2t_Qwx0EyLzU-123ABCkk578Dq2d1GEJ
|
@ -12,7 +12,7 @@ class SQLiteReader
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->dbFile = 'otadb.db3';
|
||||
$this->dbFile = __DIR__ . '/../../otadb.db3';
|
||||
$this->pdo = new \PDO('sqlite:' . $this->dbFile);
|
||||
if ($this->pdo === false) {
|
||||
return false;
|
||||
|
@ -9,7 +9,7 @@ class SQLiteWriter
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->dbFile = 'otadb.db3';
|
||||
$this->dbFile = __DIR__ . '/../../otadb.db3';
|
||||
$this->pdo = new \PDO('sqlite:' . $this->dbFile);
|
||||
if ($this->pdo === false) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user