aboutsummaryrefslogtreecommitdiffhomepage
path: root/install/wallabag_compatibility_test.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-01-27 00:41:25 +0100
committerThomas Citharel <tcit@tcit.fr>2015-01-27 00:41:25 +0100
commitca056e7fd1e2bcc8390aabdc6b4fcb84aeb0d302 (patch)
tree010c19090f2b26c0634d59694d66c1af0e3772a8 /install/wallabag_compatibility_test.php
parent369e00e60baf47170e7438d4518b4b17f82968ab (diff)
downloadwallabag-ca056e7fd1e2bcc8390aabdc6b4fcb84aeb0d302.tar.gz
wallabag-ca056e7fd1e2bcc8390aabdc6b4fcb84aeb0d302.tar.zst
wallabag-ca056e7fd1e2bcc8390aabdc6b4fcb84aeb0d302.zip
changes for 1026 for PDO exceptions
Diffstat (limited to 'install/wallabag_compatibility_test.php')
-rw-r--r--install/wallabag_compatibility_test.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/install/wallabag_compatibility_test.php b/install/wallabag_compatibility_test.php
index 8a0656cf..1093b2a3 100644
--- a/install/wallabag_compatibility_test.php
+++ b/install/wallabag_compatibility_test.php
@@ -52,4 +52,36 @@ function isPassing() {
52 return !in_array(false, $status); 52 return !in_array(false, $status);
53} 53}
54 54
55/* Function taken from at http://php.net/manual/en/function.rmdir.php#110489
56 * Idea : nbari at dalmp dot com
57 * Rights unknown
58 * Here in case of .gitignore files
59 */
60
61function delTree($dir) {
62 $files = array_diff(scandir($dir), array('.','..'));
63 foreach ($files as $file) {
64 (is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
65 }
66 return rmdir($dir);
67 }
68
69function generate_salt() {
70 mt_srand(microtime(true)*100000 + memory_get_usage(true));
71 return md5(uniqid(mt_rand(), true));
72}
73
74function executeQuery($handle, $sql, $params) {
75 try
76 {
77 $query = $handle->prepare($sql);
78 $query->execute($params);
79 return $query->fetchAll();
80 }
81 catch (Exception $e)
82 {
83 return FALSE;
84 }
85}
86
55?> \ No newline at end of file 87?> \ No newline at end of file