Skip to content

Commit 363fc2e

Browse files
committed
Merge branch 'develop' of https://github.com/codeigniter4/CodeIgniter4 into develop
2 parents 07966c4 + 8a0f7b4 commit 363fc2e

28 files changed

Lines changed: 217 additions & 3304 deletions

app/Config/Email.php

Lines changed: 0 additions & 161 deletions
This file was deleted.

system/Config/Services.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -150,34 +150,6 @@ public static function curlrequest(array $options = [], $response = null, \Confi
150150

151151
//--------------------------------------------------------------------
152152

153-
/**
154-
* The Email class allows you to send email via mail, sendmail, SMTP.
155-
*
156-
* @param null $config
157-
* @param boolean $getShared
158-
*
159-
* @return \CodeIgniter\Email\Email|mixed
160-
*/
161-
public static function email($config = null, bool $getShared = true)
162-
{
163-
if ($getShared)
164-
{
165-
return static::getSharedInstance('email', $config);
166-
}
167-
168-
if (empty($config))
169-
{
170-
$config = new \Config\Email();
171-
}
172-
173-
$email = new \CodeIgniter\Email\Email($config);
174-
$email->setLogger(static::logger(true));
175-
176-
return $email;
177-
}
178-
179-
//--------------------------------------------------------------------
180-
181153
/**
182154
* The Exceptions class holds the methods that handle:
183155
*

system/Database/BaseBuilder.php

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,11 +1399,32 @@ public function getCompiledSelect($reset = true)
13991399
$this->resetSelect();
14001400
}
14011401

1402-
return $select;
1402+
return $this->compileFinalQuery($select);
14031403
}
14041404

14051405
//--------------------------------------------------------------------
14061406

1407+
/**
1408+
* Returns a finalized, compiled query string with the bindings
1409+
* inserted and prefixes swapped out.
1410+
*
1411+
* @param string $sql
1412+
*
1413+
* @return mixed|string
1414+
*/
1415+
protected function compileFinalQuery(string $sql): string
1416+
{
1417+
$query = new Query($this->db);
1418+
$query->setQuery($sql, $this->binds);
1419+
1420+
if (! empty($this->db->swapPre) && ! empty($this->db->DBPrefix))
1421+
{
1422+
$query->swapPrefix($this->db->DBPrefix, $this->db->swapPre);
1423+
}
1424+
1425+
return $query->getQuery();
1426+
}
1427+
14071428
/**
14081429
* Get
14091430
*
@@ -1741,7 +1762,7 @@ public function getCompiledInsert($reset = true)
17411762
$this->resetWrite();
17421763
}
17431764

1744-
return $sql;
1765+
return $this->compileFinalQuery($sql);
17451766
}
17461767

17471768
//--------------------------------------------------------------------
@@ -1931,7 +1952,7 @@ public function getCompiledUpdate($reset = true)
19311952
$this->resetWrite();
19321953
}
19331954

1934-
return $sql;
1955+
return $this->compileFinalQuery($sql);
19351956
}
19361957

19371958
//--------------------------------------------------------------------
@@ -2312,7 +2333,7 @@ public function getCompiledDelete($reset = true)
23122333
$sql = $this->delete($table, '', null, $reset);
23132334
$this->returnDeleteSQL = false;
23142335

2315-
return $sql;
2336+
return $this->compileFinalQuery($sql);
23162337
}
23172338

23182339
//--------------------------------------------------------------------

system/Database/MigrationRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public function latestAll(string $group = null)
322322
}
323323

324324
// Get all namespaces form PSR4 paths.
325-
$config = new Autoload();
325+
$config = config('Autoload');
326326
$namespaces = $config->psr4;
327327

328328
foreach ($namespaces as $namespace => $path)

0 commit comments

Comments
 (0)