mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch '2.7' into 2.8
This commit is contained in:
commit
b5e64bbad5
3 changed files with 18 additions and 4 deletions
|
@ -16,9 +16,6 @@
|
|||
::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:: In order for this script to work as intended, the cake\console\ folder must be in your PATH
|
||||
|
||||
@echo.
|
||||
@echo off
|
||||
|
||||
SET app=%0
|
||||
|
|
|
@ -301,6 +301,23 @@ class FileTest extends CakeTestCase {
|
|||
$this->assertTrue($File->exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the exists() method.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testExists() {
|
||||
$tmpFile = TMP . 'tests/cakephp.file.test.tmp';
|
||||
$file = new File($tmpFile, true, 0777);
|
||||
$this->assertTrue($file->exists(), 'absolute path should exist');
|
||||
|
||||
$file = new File('file://' . $tmpFile, false);
|
||||
$this->assertTrue($file->exists(), 'file:// should exist.');
|
||||
|
||||
$file = new File('/something/bad', false);
|
||||
$this->assertFalse($file->exists(), 'missing file should not exist.');
|
||||
}
|
||||
|
||||
/**
|
||||
* testOpeningNonExistentFileCreatesIt method
|
||||
*
|
||||
|
|
|
@ -821,13 +821,13 @@ class Folder {
|
|||
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::realpath
|
||||
*/
|
||||
public function realpath($path) {
|
||||
$path = str_replace('/', DS, trim($path));
|
||||
if (strpos($path, '..') === false) {
|
||||
if (!Folder::isAbsolute($path)) {
|
||||
$path = Folder::addPathElement($this->path, $path);
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
$path = str_replace('/', DS, trim($path));
|
||||
$parts = explode(DS, $path);
|
||||
$newparts = array();
|
||||
$newpath = '';
|
||||
|
|
Loading…
Reference in a new issue