Skip to content

Commit

Permalink
Resolved #11, Update Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dusta authored Dec 5, 2018
1 parent 740cea4 commit 8908e7d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public function get($adapter, $path, $cache = false)

if ($cache != false) {
if ($cache === true) {
$row['cache'] = $this->baseClass->db->select('files_cache', '*', ['file_id' => $row['file_id']])->results();
$row['cache'] = $this->baseClass->db->select('file_cache', '*', ['file_id' => $row['file_id']])->results();
} else {
$row['cache'] = $this->baseClass->db->select('files_cache', '*', ['file_cache_path' => $cache])->result();
$row['cache'] = $this->baseClass->db->select('file_cache', '*', ['file_cache_path' => $cache])->result();
}
}

Expand Down Expand Up @@ -75,7 +75,7 @@ public function cache($adapter, $originalPath, $cachePath, $mime, $stream = fals
$row['file_id'] = $put['lastInsertId'];
}

$cache = $this->baseClass->db->select('files_cache', '*', ['file_cache_path' => $cachePath])->result();
$cache = $this->baseClass->db->select('file_cache', '*', ['file_cache_path' => $cachePath])->result();
if (empty($cache['id']) and !empty($row['file_id'])) {
$data = [
'file_id' => $row['file_id'],
Expand All @@ -88,7 +88,7 @@ public function cache($adapter, $originalPath, $cachePath, $mime, $stream = fals
// $data['file_cache_metadata'] = json_encode($metadata->get());
// }

$getLastInsertId = $this->baseClass->db->insert('files_cache', $data);
$getLastInsertId = $this->baseClass->db->insert('file_cache', $data);
return $this->methodResult(true, ['lastInsertId' => $getLastInsertId]);
}

Expand All @@ -107,7 +107,7 @@ public function drop($adapter, $path)
$this->baseClass->db->start();
$row = $this->baseClass->db->pdoQuery('SELECT * FROM files WHERE `file_path` = ?', [$path])->result();

$affectedRows = $this->baseClass->db->delete('files_cache', ['file_id' => $row['file_id']])->affectedRows();
$affectedRows = $this->baseClass->db->delete('file_cache', ['file_id' => $row['file_id']])->affectedRows();
$affectedRows = $this->baseClass->db->delete('files', ['file_id' => $row['file_id']])->affectedRows();

$this->baseClass->db->end();
Expand Down

0 comments on commit 8908e7d

Please sign in to comment.