mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-01 14:49:15 +00:00
changes for 1026 for PDO exceptions
This commit is contained in:
parent
369e00e60b
commit
ca056e7fd1
2 changed files with 130 additions and 140 deletions
File diff suppressed because one or more lines are too long
|
@ -52,4 +52,36 @@ function isPassing() {
|
||||||
return !in_array(false, $status);
|
return !in_array(false, $status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Function taken from at http://php.net/manual/en/function.rmdir.php#110489
|
||||||
|
* Idea : nbari at dalmp dot com
|
||||||
|
* Rights unknown
|
||||||
|
* Here in case of .gitignore files
|
||||||
|
*/
|
||||||
|
|
||||||
|
function delTree($dir) {
|
||||||
|
$files = array_diff(scandir($dir), array('.','..'));
|
||||||
|
foreach ($files as $file) {
|
||||||
|
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
|
||||||
|
}
|
||||||
|
return rmdir($dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
function generate_salt() {
|
||||||
|
mt_srand(microtime(true)*100000 + memory_get_usage(true));
|
||||||
|
return md5(uniqid(mt_rand(), true));
|
||||||
|
}
|
||||||
|
|
||||||
|
function executeQuery($handle, $sql, $params) {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$query = $handle->prepare($sql);
|
||||||
|
$query->execute($params);
|
||||||
|
return $query->fetchAll();
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in a new issue