mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 13:02:40 +00:00
More optimization refactoring.
Fix cache but causing object_map to be created and deleted on each request. Replacing function and method calls with better performing code. git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7596 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
c9c18741fb
commit
cb487bd6e6
37 changed files with 183 additions and 182 deletions
|
@ -211,7 +211,7 @@ class File extends Object {
|
|||
*/
|
||||
function prepare($data, $forceWindows = false) {
|
||||
$lineBreak = "\n";
|
||||
if (substr(PHP_OS,0,3) == "WIN" || $forceWindows === true) {
|
||||
if (DIRECTORY_SEPARATOR == '\\' || $forceWindows === true) {
|
||||
$lineBreak = "\r\n";
|
||||
}
|
||||
return strtr($data, array("\r\n" => $lineBreak, "\n" => $lineBreak, "\r" => $lineBreak));
|
||||
|
@ -341,7 +341,7 @@ class File extends Object {
|
|||
if (!$ext) {
|
||||
$ext = $this->ext();
|
||||
}
|
||||
return preg_replace( "/[^\w\.-]+/", "_", basename($name, $ext));
|
||||
return preg_replace( "/(?:[^\w\.-]+)/", "_", basename($name, $ext));
|
||||
}
|
||||
/**
|
||||
* Get md5 Checksum of file with previous check of Filesize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue