mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch '1.3' into merger
Conflicts: cake/libs/controller/components/email.php cake/tests/cases/console/libs/tasks/fixture.test.php lib/Cake/Console/Command/Task/DbConfigTask.php
This commit is contained in:
commit
efbeab6199
5 changed files with 29 additions and 3 deletions
|
@ -196,8 +196,8 @@
|
|||
* Will append a querystring parameter containing the time the file was modified. This is
|
||||
* useful for invalidating browser caches.
|
||||
*
|
||||
* Set to `true` to apply timestamps, when debug = 0, or set to 'force' to always enable
|
||||
* timestamping.
|
||||
* Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
|
||||
* timestamping regardless of debug value.
|
||||
*/
|
||||
//Configure::write('Asset.timestamp', true);
|
||||
/**
|
||||
|
|
|
@ -404,6 +404,9 @@ class FixtureTask extends BakeTask {
|
|||
foreach ($records as $record) {
|
||||
$row = array();
|
||||
foreach ($record[$modelObject->alias] as $field => $value) {
|
||||
if ($schema[$field]['type'] === 'boolean') {
|
||||
$value = (int)(bool)$value;
|
||||
}
|
||||
$row[$field] = $value;
|
||||
}
|
||||
$out[] = $row;
|
||||
|
|
|
@ -187,6 +187,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
));
|
||||
|
||||
$this->assertRegExp("/'body' => 'Body \"value\"'/", $result, 'Data has bad escaping');
|
||||
$this->assertRegExp("/'bool' => 1/", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -399,7 +399,7 @@ class FileTest extends CakeTestCase {
|
|||
public function testDelete() {
|
||||
if (!$tmpFile = $this->_getTmpFile()) {
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
if (!file_exists($tmpFile)) {
|
||||
touch($tmpFile);
|
||||
|
@ -415,6 +415,24 @@ class FileTest extends CakeTestCase {
|
|||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Windows has issues unlinking files if there are
|
||||
* active filehandles open.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDeleteAfterRead() {
|
||||
if (!$tmpFile = $this->_getTmpFile()) {
|
||||
return false;
|
||||
}
|
||||
if (!file_exists($tmpFile)) {
|
||||
touch($tmpFile);
|
||||
}
|
||||
$file =& new File($tmpFile);
|
||||
$file->read();
|
||||
$this->assertTrue($file->delete());
|
||||
}
|
||||
|
||||
/**
|
||||
* testCopy method
|
||||
*
|
||||
|
|
|
@ -268,6 +268,10 @@ class File {
|
|||
*/
|
||||
public function delete() {
|
||||
clearstatcache();
|
||||
if (is_resource($this->handle)) {
|
||||
fclose($this->handle);
|
||||
$this->handle = null;
|
||||
}
|
||||
if ($this->exists()) {
|
||||
return unlink($this->path);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue