type fixes

This commit is contained in:
Shish 2019-10-02 09:03:14 +01:00
parent 785e5b67e6
commit 704cab4470
3 changed files with 15 additions and 21 deletions

View File

@ -364,19 +364,10 @@ function insert_defaults()
function build_dirs()
{ // {{{
// *try* and make default dirs. Ignore any errors --
// if something is amiss, we'll tell the user later
if (!file_exists("data")) {
@mkdir("data");
}
if (!is_writable("data")) {
@chmod("data", 0755);
}
$data_exists = file_exists("data") || mkdir("data");
$data_writable = is_writable("data") || chmod("data", 0755);
// Clear file status cache before checking again.
clearstatcache();
if (!file_exists("data") || !is_writable("data")) {
if (!$data_exists || !$data_writable) {
print "
<div id='installer'>
<h1>Shimmie Installer</h1>

View File

@ -203,7 +203,8 @@ class Database
$stmt = $this->db->prepare(
"-- " . str_replace("%2F", "/", urlencode(@$_GET['q'])). "\n" .
$query
);
)
assert(!is_bool($stmt));;
// $stmt = $this->db->prepare($query);
if (!array_key_exists(0, $args)) {
foreach ($args as $name=>$value) {
@ -308,10 +309,12 @@ class Database
public function get_last_insert_id(string $seq): int
{
if ($this->engine->name == DatabaseDriver::PGSQL) {
return $this->db->lastInsertId($seq);
$id = $this->db->lastInsertId($seq);
} else {
return $this->db->lastInsertId();
$id = $this->db->lastInsertId();
}
assert(is_numeric($id));
return (int)$id;
}
/**