Fixed bug in creating data directories due to our string interpolation changes.
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'%(path)/db/archive',
|
||||
'%(path)/config',
|
||||
'%(path)/backup',
|
||||
'%(tmpDir)/logs',
|
||||
'%(tmpDir)/cache',
|
||||
'%(tmpDir)/profiler',
|
||||
'%(tmpDir)/webhooks',
|
||||
'%(tmpDir)/debug',
|
||||
'{path}/db/archive',
|
||||
'{path}/config',
|
||||
'{path}/backup',
|
||||
'{tmpDir}/logs',
|
||||
'{tmpDir}/cache',
|
||||
'{tmpDir}/profiler',
|
||||
'{tmpDir}/webhooks',
|
||||
'{tmpDir}/debug',
|
||||
];
|
||||
|
||||
@@ -329,13 +329,13 @@ final class PDOAdapter implements iDB
|
||||
|
||||
public function commit(array $entities, array $opts = []): array
|
||||
{
|
||||
$actions = [
|
||||
'added' => 0,
|
||||
'updated' => 0,
|
||||
'failed' => 0,
|
||||
];
|
||||
return $this->transactional(function () use ($entities) {
|
||||
$actions = [
|
||||
'added' => 0,
|
||||
'updated' => 0,
|
||||
'failed' => 0,
|
||||
];
|
||||
|
||||
return $this->transactional(function () use ($entities, $actions) {
|
||||
foreach ($entities as $entity) {
|
||||
try {
|
||||
if (null === $entity->id) {
|
||||
@@ -474,7 +474,7 @@ final class PDOAdapter implements iDB
|
||||
*/
|
||||
private function pdoInsert(string $table, array $columns): string
|
||||
{
|
||||
$queryString = "INSERT INTO {$table} (%(columns)) VALUES(%(values))";
|
||||
$queryString = "INSERT INTO {$table} ({columns}) VALUES({values})";
|
||||
|
||||
$sql_columns = $sql_placeholder = [];
|
||||
|
||||
@@ -488,7 +488,7 @@ final class PDOAdapter implements iDB
|
||||
}
|
||||
|
||||
$queryString = str_replace(
|
||||
['%(columns)', '%(values)'],
|
||||
['{columns}', '{values}'],
|
||||
[implode(', ', $sql_columns), implode(', ', $sql_placeholder)],
|
||||
$queryString
|
||||
);
|
||||
@@ -506,7 +506,7 @@ final class PDOAdapter implements iDB
|
||||
private function pdoUpdate(string $table, array $columns): string
|
||||
{
|
||||
/** @noinspection SqlWithoutWhere */
|
||||
$queryString = "UPDATE {$table} SET %(place) = %(holder) WHERE " . iState::COLUMN_ID . " = :id";
|
||||
$queryString = "UPDATE {$table} SET {place} = {holder} WHERE " . iState::COLUMN_ID . " = :id";
|
||||
|
||||
$placeholders = [];
|
||||
|
||||
@@ -517,7 +517,7 @@ final class PDOAdapter implements iDB
|
||||
$placeholders[] = r('{column} = :{column}', ['column' => $column]);
|
||||
}
|
||||
|
||||
return trim(str_replace('%(place) = %(holder)', implode(', ', $placeholders), $queryString));
|
||||
return trim(str_replace('{place} = {holder}', implode(', ', $placeholders), $queryString));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -450,7 +450,7 @@ final class Initializer
|
||||
];
|
||||
|
||||
foreach (require $dirList as $dir) {
|
||||
$dir = str_replace(array_keys($list), array_values($list), $dir);
|
||||
$dir = r($dir, $list);
|
||||
|
||||
if (false === file_exists($dir)) {
|
||||
if (false === @mkdir($dir, 0755, true) && false === is_dir($dir)) {
|
||||
|
||||
Reference in New Issue
Block a user