From d22cb4e8eab080beecd00ca753b5c08aeb29d430 Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Mon, 25 Jun 2012 11:05:01 +0000 Subject: [PATCH] 1. Dodanie pustych katalogów ./cache, ./db oraz ./data/*/archiwum. 2. Uwzględnienie w pliku budowania wyżej wymienionych katalogów. 3. Usunięcie linii dotyczących nieistniejącego katalogu ./test w BUILD. 4. Usuniecie sprawdzania możliwości zapisu do ./database jeśli katalog nie istnieje (test.php). 5. BotSession nie próbuje już usunąć pliku starej bazy (database/...), jeśli nie istnieje. 6. Wyciszenie błędów o brakującch indeksach w tablicy (wyniku parse_url) w BotUser. --- data/humor/archiwum/.emptydir | 0 cache/.emptydir | 0 class/BotUser.php | 6 +++--- BUILD | 10 ++++++---- test.php | 4 +++- class/BotSession.php | 6 ++++-- data/lotto/archiwum/.emptydir | 0 data/kurs/archiwum/.emptydir | 0 db/.emptydir | 0 data/tv/cache/.emptydir | 0 10 files changed, 16 insertions(+), 10 deletions(-) diff --git a/BUILD b/BUILD index dcb601c..806164d 100644 --- a/BUILD +++ b/BUILD @@ -5,10 +5,12 @@ # GIT REMOVEGLOB /.git/* REMOVEDIR /.git - -# TEST -REMOVEGLOB /test/* -REMOVEDIR /test +REMOVE /cache/.emptydir +REMOVE /data/humor/archiwum/.emptydir +REMOVE /data/kurs/archiwum/.emptydir +REMOVE /data/lotto/archiwum/.emptydir +REMOVE /data/tv/cache/.emptydir +REMOVE /db/.emptydir # Moje ustawienia REPLACEBETWEEN /class/config.php "'numer' => '" ' "" diff --git a/cache/.emptydir b/cache/.emptydir new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/cache/.emptydir diff --git a/class/BotSession.php b/class/BotSession.php index a70734e..20088e3 100644 --- a/class/BotSession.php +++ b/class/BotSession.php @@ -72,7 +72,9 @@ } } catch(Exception $e) { - @unlink(BOT_TOPDIR.'/database/'.sha1($this->user).'.sqlite'); + if(file_exists(BOT_TOPDIR.'/database/'.sha1($this->user).'.sqlite')) { + @unlink(BOT_TOPDIR.'/database/'.sha1($this->user).'.sqlite'); + } throw $e; } } @@ -147,4 +149,4 @@ $st->execute(array($this->class)); } } -?> \ No newline at end of file +?> diff --git a/class/BotUser.php b/class/BotUser.php index 0040e3a..1326f8c 100644 --- a/class/BotUser.php +++ b/class/BotUser.php @@ -51,12 +51,12 @@ $this->interface = $data['scheme']; $this->uid = strtr($data['user'], array('\\@' => '@')); $this->network = $data['host']; - $this->bot = substr($data['path'], 1); - $this->params = $data['query']; + $this->bot = substr(@$data['path'], 1); + $this->params = @$data['query']; } function __get($name) { return $this->$name; } } -?> \ No newline at end of file +?> diff --git a/data/humor/archiwum/.emptydir b/data/humor/archiwum/.emptydir new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/data/humor/archiwum/.emptydir diff --git a/data/kurs/archiwum/.emptydir b/data/kurs/archiwum/.emptydir new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/data/kurs/archiwum/.emptydir diff --git a/data/lotto/archiwum/.emptydir b/data/lotto/archiwum/.emptydir new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/data/lotto/archiwum/.emptydir diff --git a/data/tv/cache/.emptydir b/data/tv/cache/.emptydir new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/data/tv/cache/.emptydir diff --git a/db/.emptydir b/db/.emptydir new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/db/.emptydir diff --git a/test.php b/test.php index 03dbbcd..e319dc1 100644 --- a/test.php +++ b/test.php @@ -50,7 +50,9 @@ testdir('./data/tv'); testdir('./data/tv/cache'); testdir('./db'); -testdir('./database'); +if(is_dir('./database')) { + testdir('./database'); +} echo '</table>'; ?> -- Gitblit v1.9.1