Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/flow-flo.../libs/cakephp/cache/Engine
File: FileEngine.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
[2] Fix | Delete
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
[3] Fix | Delete
*
[4] Fix | Delete
* Licensed under The MIT License
[5] Fix | Delete
* For full copyright and license information, please see the LICENSE.txt
[6] Fix | Delete
* Redistributions of files must retain the above copyright notice.
[7] Fix | Delete
*
[8] Fix | Delete
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
[9] Fix | Delete
* @link https://cakephp.org CakePHP(tm) Project
[10] Fix | Delete
* @since 1.2.0
[11] Fix | Delete
* @license https://opensource.org/licenses/mit-license.php MIT License
[12] Fix | Delete
*/
[13] Fix | Delete
namespace Cake\Cache\Engine;
[14] Fix | Delete
[15] Fix | Delete
use Cake\Cache\CacheEngine;
[16] Fix | Delete
use Cake\Utility\Inflector;
[17] Fix | Delete
use CallbackFilterIterator;
[18] Fix | Delete
use Exception;
[19] Fix | Delete
use LogicException;
[20] Fix | Delete
use RecursiveDirectoryIterator;
[21] Fix | Delete
use RecursiveIteratorIterator;
[22] Fix | Delete
use SplFileInfo;
[23] Fix | Delete
use SplFileObject;
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* File Storage engine for cache. Filestorage is the slowest cache storage
[27] Fix | Delete
* to read and write. However, it is good for servers that don't have other storage
[28] Fix | Delete
* engine available, or have content which is not performance sensitive.
[29] Fix | Delete
*
[30] Fix | Delete
* You can configure a FileEngine cache, using Cache::config()
[31] Fix | Delete
*/
[32] Fix | Delete
class FileEngine extends CacheEngine
[33] Fix | Delete
{
[34] Fix | Delete
/**
[35] Fix | Delete
* Instance of SplFileObject class
[36] Fix | Delete
*
[37] Fix | Delete
* @var \SplFileObject|null
[38] Fix | Delete
*/
[39] Fix | Delete
protected $_File;
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* The default config used unless overridden by runtime configuration
[43] Fix | Delete
*
[44] Fix | Delete
* - `duration` Specify how long items in this cache configuration last.
[45] Fix | Delete
* - `groups` List of groups or 'tags' associated to every key stored in this config.
[46] Fix | Delete
* handy for deleting a complete group from cache.
[47] Fix | Delete
* - `isWindows` Automatically populated with whether the host is windows or not
[48] Fix | Delete
* - `lock` Used by FileCache. Should files be locked before writing to them?
[49] Fix | Delete
* - `mask` The mask used for created files
[50] Fix | Delete
* - `path` Path to where cachefiles should be saved. Defaults to system's temp dir.
[51] Fix | Delete
* - `prefix` Prepended to all entries. Good for when you need to share a keyspace
[52] Fix | Delete
* with either another cache config or another application.
[53] Fix | Delete
* - `probability` Probability of hitting a cache gc cleanup. Setting to 0 will disable
[54] Fix | Delete
* cache::gc from ever being called automatically.
[55] Fix | Delete
* - `serialize` Should cache objects be serialized first.
[56] Fix | Delete
*
[57] Fix | Delete
* @var array
[58] Fix | Delete
*/
[59] Fix | Delete
protected $_defaultConfig = [
[60] Fix | Delete
'duration' => 3600,
[61] Fix | Delete
'groups' => [],
[62] Fix | Delete
'isWindows' => false,
[63] Fix | Delete
'lock' => true,
[64] Fix | Delete
'mask' => 0664,
[65] Fix | Delete
'path' => null,
[66] Fix | Delete
'prefix' => 'cake_',
[67] Fix | Delete
'probability' => 100,
[68] Fix | Delete
'serialize' => true,
[69] Fix | Delete
];
[70] Fix | Delete
[71] Fix | Delete
/**
[72] Fix | Delete
* True unless FileEngine::__active(); fails
[73] Fix | Delete
*
[74] Fix | Delete
* @var bool
[75] Fix | Delete
*/
[76] Fix | Delete
protected $_init = true;
[77] Fix | Delete
[78] Fix | Delete
/**
[79] Fix | Delete
* Initialize File Cache Engine
[80] Fix | Delete
*
[81] Fix | Delete
* Called automatically by the cache frontend.
[82] Fix | Delete
*
[83] Fix | Delete
* @param array $config array of setting for the engine
[84] Fix | Delete
* @return bool True if the engine has been successfully initialized, false if not
[85] Fix | Delete
*/
[86] Fix | Delete
public function init(array $config = [])
[87] Fix | Delete
{
[88] Fix | Delete
parent::init($config);
[89] Fix | Delete
[90] Fix | Delete
if ($this->_config['path'] === null) {
[91] Fix | Delete
$this->_config['path'] = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'cake_cache' . DIRECTORY_SEPARATOR;
[92] Fix | Delete
}
[93] Fix | Delete
if (DIRECTORY_SEPARATOR === '\\') {
[94] Fix | Delete
$this->_config['isWindows'] = true;
[95] Fix | Delete
}
[96] Fix | Delete
if (substr($this->_config['path'], -1) !== DIRECTORY_SEPARATOR) {
[97] Fix | Delete
$this->_config['path'] .= DIRECTORY_SEPARATOR;
[98] Fix | Delete
}
[99] Fix | Delete
if ($this->_groupPrefix) {
[100] Fix | Delete
$this->_groupPrefix = str_replace('_', DIRECTORY_SEPARATOR, $this->_groupPrefix);
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
return $this->_active();
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* Garbage collection. Permanently remove all expired and deleted data
[108] Fix | Delete
*
[109] Fix | Delete
* @param int|null $expires [optional] An expires timestamp, invalidating all data before.
[110] Fix | Delete
* @return bool True if garbage collection was successful, false on failure
[111] Fix | Delete
*/
[112] Fix | Delete
public function gc($expires = null)
[113] Fix | Delete
{
[114] Fix | Delete
return $this->clear(true);
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
/**
[118] Fix | Delete
* Write data for key into cache
[119] Fix | Delete
*
[120] Fix | Delete
* @param string $key Identifier for the data
[121] Fix | Delete
* @param mixed $data Data to be cached
[122] Fix | Delete
* @return bool True if the data was successfully cached, false on failure
[123] Fix | Delete
*/
[124] Fix | Delete
public function write($key, $data)
[125] Fix | Delete
{
[126] Fix | Delete
if ($data === '' || !$this->_init) {
[127] Fix | Delete
return false;
[128] Fix | Delete
}
[129] Fix | Delete
[130] Fix | Delete
$key = $this->_key($key);
[131] Fix | Delete
[132] Fix | Delete
if ($this->_setKey($key, true) === false) {
[133] Fix | Delete
return false;
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
$lineBreak = "\n";
[137] Fix | Delete
[138] Fix | Delete
if ($this->_config['isWindows']) {
[139] Fix | Delete
$lineBreak = "\r\n";
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
if (!empty($this->_config['serialize'])) {
[143] Fix | Delete
if ($this->_config['isWindows']) {
[144] Fix | Delete
$data = str_replace('\\', '\\\\\\\\', serialize($data));
[145] Fix | Delete
} else {
[146] Fix | Delete
$data = serialize($data);
[147] Fix | Delete
}
[148] Fix | Delete
}
[149] Fix | Delete
[150] Fix | Delete
$duration = $this->_config['duration'];
[151] Fix | Delete
$expires = time() + $duration;
[152] Fix | Delete
$contents = implode([$expires, $lineBreak, $data, $lineBreak]);
[153] Fix | Delete
[154] Fix | Delete
if ($this->_config['lock']) {
[155] Fix | Delete
$this->_File->flock(LOCK_EX);
[156] Fix | Delete
}
[157] Fix | Delete
[158] Fix | Delete
$this->_File->rewind();
[159] Fix | Delete
$success = $this->_File->ftruncate(0) &&
[160] Fix | Delete
$this->_File->fwrite($contents) &&
[161] Fix | Delete
$this->_File->fflush();
[162] Fix | Delete
[163] Fix | Delete
if ($this->_config['lock']) {
[164] Fix | Delete
$this->_File->flock(LOCK_UN);
[165] Fix | Delete
}
[166] Fix | Delete
$this->_File = null;
[167] Fix | Delete
[168] Fix | Delete
return $success;
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
/**
[172] Fix | Delete
* Read a key from the cache
[173] Fix | Delete
*
[174] Fix | Delete
* @param string $key Identifier for the data
[175] Fix | Delete
* @return mixed The cached data, or false if the data doesn't exist, has
[176] Fix | Delete
* expired, or if there was an error fetching it
[177] Fix | Delete
*/
[178] Fix | Delete
public function read($key)
[179] Fix | Delete
{
[180] Fix | Delete
$key = $this->_key($key);
[181] Fix | Delete
[182] Fix | Delete
if (!$this->_init || $this->_setKey($key) === false) {
[183] Fix | Delete
return false;
[184] Fix | Delete
}
[185] Fix | Delete
[186] Fix | Delete
if ($this->_config['lock']) {
[187] Fix | Delete
$this->_File->flock(LOCK_SH);
[188] Fix | Delete
}
[189] Fix | Delete
[190] Fix | Delete
$this->_File->rewind();
[191] Fix | Delete
$time = time();
[192] Fix | Delete
$cachetime = (int)$this->_File->current();
[193] Fix | Delete
[194] Fix | Delete
if ($cachetime < $time) {
[195] Fix | Delete
if ($this->_config['lock']) {
[196] Fix | Delete
$this->_File->flock(LOCK_UN);
[197] Fix | Delete
}
[198] Fix | Delete
[199] Fix | Delete
return false;
[200] Fix | Delete
}
[201] Fix | Delete
[202] Fix | Delete
$data = '';
[203] Fix | Delete
$this->_File->next();
[204] Fix | Delete
while ($this->_File->valid()) {
[205] Fix | Delete
$data .= $this->_File->current();
[206] Fix | Delete
$this->_File->next();
[207] Fix | Delete
}
[208] Fix | Delete
[209] Fix | Delete
if ($this->_config['lock']) {
[210] Fix | Delete
$this->_File->flock(LOCK_UN);
[211] Fix | Delete
}
[212] Fix | Delete
[213] Fix | Delete
$data = trim($data);
[214] Fix | Delete
[215] Fix | Delete
if ($data !== '' && !empty($this->_config['serialize'])) {
[216] Fix | Delete
if ($this->_config['isWindows']) {
[217] Fix | Delete
$data = str_replace('\\\\\\\\', '\\', $data);
[218] Fix | Delete
}
[219] Fix | Delete
$data = unserialize((string)$data);
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
return $data;
[223] Fix | Delete
}
[224] Fix | Delete
[225] Fix | Delete
/**
[226] Fix | Delete
* Delete a key from the cache
[227] Fix | Delete
*
[228] Fix | Delete
* @param string $key Identifier for the data
[229] Fix | Delete
* @return bool True if the value was successfully deleted, false if it didn't
[230] Fix | Delete
* exist or couldn't be removed
[231] Fix | Delete
*/
[232] Fix | Delete
public function delete($key)
[233] Fix | Delete
{
[234] Fix | Delete
$key = $this->_key($key);
[235] Fix | Delete
[236] Fix | Delete
if ($this->_setKey($key) === false || !$this->_init) {
[237] Fix | Delete
return false;
[238] Fix | Delete
}
[239] Fix | Delete
[240] Fix | Delete
$path = $this->_File->getRealPath();
[241] Fix | Delete
$this->_File = null;
[242] Fix | Delete
[243] Fix | Delete
//@codingStandardsIgnoreStart
[244] Fix | Delete
return @unlink($path);
[245] Fix | Delete
//@codingStandardsIgnoreEnd
[246] Fix | Delete
}
[247] Fix | Delete
[248] Fix | Delete
/**
[249] Fix | Delete
* Delete all values from the cache
[250] Fix | Delete
*
[251] Fix | Delete
* @param bool $check Optional - only delete expired cache items
[252] Fix | Delete
* @return bool True if the cache was successfully cleared, false otherwise
[253] Fix | Delete
*/
[254] Fix | Delete
public function clear($check)
[255] Fix | Delete
{
[256] Fix | Delete
if (!$this->_init) {
[257] Fix | Delete
return false;
[258] Fix | Delete
}
[259] Fix | Delete
$this->_File = null;
[260] Fix | Delete
[261] Fix | Delete
$threshold = $now = false;
[262] Fix | Delete
if ($check) {
[263] Fix | Delete
$now = time();
[264] Fix | Delete
$threshold = $now - $this->_config['duration'];
[265] Fix | Delete
}
[266] Fix | Delete
[267] Fix | Delete
$this->_clearDirectory($this->_config['path'], $now, $threshold);
[268] Fix | Delete
[269] Fix | Delete
$directory = new RecursiveDirectoryIterator(
[270] Fix | Delete
$this->_config['path'],
[271] Fix | Delete
\FilesystemIterator::SKIP_DOTS
[272] Fix | Delete
);
[273] Fix | Delete
$contents = new RecursiveIteratorIterator(
[274] Fix | Delete
$directory,
[275] Fix | Delete
RecursiveIteratorIterator::SELF_FIRST
[276] Fix | Delete
);
[277] Fix | Delete
$cleared = [];
[278] Fix | Delete
foreach ($contents as $path) {
[279] Fix | Delete
if ($path->isFile()) {
[280] Fix | Delete
continue;
[281] Fix | Delete
}
[282] Fix | Delete
[283] Fix | Delete
$path = $path->getRealPath() . DIRECTORY_SEPARATOR;
[284] Fix | Delete
if (!in_array($path, $cleared, true)) {
[285] Fix | Delete
$this->_clearDirectory($path, $now, $threshold);
[286] Fix | Delete
$cleared[] = $path;
[287] Fix | Delete
}
[288] Fix | Delete
}
[289] Fix | Delete
[290] Fix | Delete
return true;
[291] Fix | Delete
}
[292] Fix | Delete
[293] Fix | Delete
/**
[294] Fix | Delete
* Used to clear a directory of matching files.
[295] Fix | Delete
*
[296] Fix | Delete
* @param string $path The path to search.
[297] Fix | Delete
* @param int $now The current timestamp
[298] Fix | Delete
* @param int $threshold Any file not modified after this value will be deleted.
[299] Fix | Delete
* @return void
[300] Fix | Delete
*/
[301] Fix | Delete
protected function _clearDirectory($path, $now, $threshold)
[302] Fix | Delete
{
[303] Fix | Delete
if (!is_dir($path)) {
[304] Fix | Delete
return;
[305] Fix | Delete
}
[306] Fix | Delete
$prefixLength = strlen($this->_config['prefix']);
[307] Fix | Delete
[308] Fix | Delete
$dir = dir($path);
[309] Fix | Delete
while (($entry = $dir->read()) !== false) {
[310] Fix | Delete
if (substr($entry, 0, $prefixLength) !== $this->_config['prefix']) {
[311] Fix | Delete
continue;
[312] Fix | Delete
}
[313] Fix | Delete
[314] Fix | Delete
try {
[315] Fix | Delete
$file = new SplFileObject($path . $entry, 'r');
[316] Fix | Delete
} catch (Exception $e) {
[317] Fix | Delete
continue;
[318] Fix | Delete
}
[319] Fix | Delete
[320] Fix | Delete
if ($threshold) {
[321] Fix | Delete
$mtime = $file->getMTime();
[322] Fix | Delete
if ($mtime > $threshold) {
[323] Fix | Delete
continue;
[324] Fix | Delete
}
[325] Fix | Delete
[326] Fix | Delete
$expires = (int)$file->current();
[327] Fix | Delete
if ($expires > $now) {
[328] Fix | Delete
continue;
[329] Fix | Delete
}
[330] Fix | Delete
}
[331] Fix | Delete
if ($file->isFile()) {
[332] Fix | Delete
$filePath = $file->getRealPath();
[333] Fix | Delete
$file = null;
[334] Fix | Delete
[335] Fix | Delete
//@codingStandardsIgnoreStart
[336] Fix | Delete
@unlink($filePath);
[337] Fix | Delete
//@codingStandardsIgnoreEnd
[338] Fix | Delete
}
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
$dir->close();
[342] Fix | Delete
}
[343] Fix | Delete
[344] Fix | Delete
/**
[345] Fix | Delete
* Not implemented
[346] Fix | Delete
*
[347] Fix | Delete
* @param string $key The key to decrement
[348] Fix | Delete
* @param int $offset The number to offset
[349] Fix | Delete
* @return void
[350] Fix | Delete
* @throws \LogicException
[351] Fix | Delete
*/
[352] Fix | Delete
public function decrement($key, $offset = 1)
[353] Fix | Delete
{
[354] Fix | Delete
throw new LogicException('Files cannot be atomically decremented.');
[355] Fix | Delete
}
[356] Fix | Delete
[357] Fix | Delete
/**
[358] Fix | Delete
* Not implemented
[359] Fix | Delete
*
[360] Fix | Delete
* @param string $key The key to increment
[361] Fix | Delete
* @param int $offset The number to offset
[362] Fix | Delete
* @return void
[363] Fix | Delete
* @throws \LogicException
[364] Fix | Delete
*/
[365] Fix | Delete
public function increment($key, $offset = 1)
[366] Fix | Delete
{
[367] Fix | Delete
throw new LogicException('Files cannot be atomically incremented.');
[368] Fix | Delete
}
[369] Fix | Delete
[370] Fix | Delete
/**
[371] Fix | Delete
* Sets the current cache key this class is managing, and creates a writable SplFileObject
[372] Fix | Delete
* for the cache file the key is referring to.
[373] Fix | Delete
*
[374] Fix | Delete
* @param string $key The key
[375] Fix | Delete
* @param bool $createKey Whether the key should be created if it doesn't exists, or not
[376] Fix | Delete
* @return bool true if the cache key could be set, false otherwise
[377] Fix | Delete
*/
[378] Fix | Delete
protected function _setKey($key, $createKey = false)
[379] Fix | Delete
{
[380] Fix | Delete
$groups = null;
[381] Fix | Delete
if ($this->_groupPrefix) {
[382] Fix | Delete
$groups = vsprintf($this->_groupPrefix, $this->groups());
[383] Fix | Delete
}
[384] Fix | Delete
$dir = $this->_config['path'] . $groups;
[385] Fix | Delete
[386] Fix | Delete
if (!is_dir($dir)) {
[387] Fix | Delete
mkdir($dir, 0775, true);
[388] Fix | Delete
}
[389] Fix | Delete
[390] Fix | Delete
$path = new SplFileInfo($dir . $key);
[391] Fix | Delete
[392] Fix | Delete
if (!$createKey && !$path->isFile()) {
[393] Fix | Delete
return false;
[394] Fix | Delete
}
[395] Fix | Delete
if (
[396] Fix | Delete
empty($this->_File) ||
[397] Fix | Delete
$this->_File->getBasename() !== $key ||
[398] Fix | Delete
$this->_File->valid() === false
[399] Fix | Delete
) {
[400] Fix | Delete
$exists = file_exists($path->getPathname());
[401] Fix | Delete
try {
[402] Fix | Delete
$this->_File = $path->openFile('c+');
[403] Fix | Delete
} catch (Exception $e) {
[404] Fix | Delete
trigger_error($e->getMessage(), E_USER_WARNING);
[405] Fix | Delete
[406] Fix | Delete
return false;
[407] Fix | Delete
}
[408] Fix | Delete
unset($path);
[409] Fix | Delete
[410] Fix | Delete
if (!$exists && !chmod($this->_File->getPathname(), (int)$this->_config['mask'])) {
[411] Fix | Delete
trigger_error(sprintf(
[412] Fix | Delete
'Could not apply permission mask "%s" on cache file "%s"',
[413] Fix | Delete
$this->_File->getPathname(),
[414] Fix | Delete
$this->_config['mask']
[415] Fix | Delete
), E_USER_WARNING);
[416] Fix | Delete
}
[417] Fix | Delete
}
[418] Fix | Delete
[419] Fix | Delete
return true;
[420] Fix | Delete
}
[421] Fix | Delete
[422] Fix | Delete
/**
[423] Fix | Delete
* Determine if cache directory is writable
[424] Fix | Delete
*
[425] Fix | Delete
* @return bool
[426] Fix | Delete
*/
[427] Fix | Delete
protected function _active()
[428] Fix | Delete
{
[429] Fix | Delete
$dir = new SplFileInfo($this->_config['path']);
[430] Fix | Delete
$path = $dir->getPathname();
[431] Fix | Delete
$success = true;
[432] Fix | Delete
if (!is_dir($path)) {
[433] Fix | Delete
//@codingStandardsIgnoreStart
[434] Fix | Delete
$success = @mkdir($path, 0775, true);
[435] Fix | Delete
//@codingStandardsIgnoreEnd
[436] Fix | Delete
}
[437] Fix | Delete
[438] Fix | Delete
$isWritableDir = ($dir->isDir() && $dir->isWritable());
[439] Fix | Delete
if (!$success || ($this->_init && !$isWritableDir)) {
[440] Fix | Delete
$this->_init = false;
[441] Fix | Delete
trigger_error(sprintf(
[442] Fix | Delete
'%s is not writable',
[443] Fix | Delete
$this->_config['path']
[444] Fix | Delete
), E_USER_WARNING);
[445] Fix | Delete
}
[446] Fix | Delete
[447] Fix | Delete
return $success;
[448] Fix | Delete
}
[449] Fix | Delete
[450] Fix | Delete
/**
[451] Fix | Delete
* Generates a safe key for use with cache engine storage engines.
[452] Fix | Delete
*
[453] Fix | Delete
* @param string $key the key passed over
[454] Fix | Delete
* @return mixed string $key or false
[455] Fix | Delete
*/
[456] Fix | Delete
public function key($key)
[457] Fix | Delete
{
[458] Fix | Delete
if (empty($key)) {
[459] Fix | Delete
return false;
[460] Fix | Delete
}
[461] Fix | Delete
[462] Fix | Delete
$key = Inflector::underscore(str_replace(
[463] Fix | Delete
[DIRECTORY_SEPARATOR, '/', '.', '<', '>', '?', ':', '|', '*', '"'],
[464] Fix | Delete
'_',
[465] Fix | Delete
(string)$key
[466] Fix | Delete
));
[467] Fix | Delete
[468] Fix | Delete
return $key;
[469] Fix | Delete
}
[470] Fix | Delete
[471] Fix | Delete
/**
[472] Fix | Delete
* Recursively deletes all files under any directory named as $group
[473] Fix | Delete
*
[474] Fix | Delete
* @param string $group The group to clear.
[475] Fix | Delete
* @return bool success
[476] Fix | Delete
*/
[477] Fix | Delete
public function clearGroup($group)
[478] Fix | Delete
{
[479] Fix | Delete
$this->_File = null;
[480] Fix | Delete
[481] Fix | Delete
$prefix = (string)$this->_config['prefix'];
[482] Fix | Delete
[483] Fix | Delete
$directoryIterator = new RecursiveDirectoryIterator($this->_config['path']);
[484] Fix | Delete
$contents = new RecursiveIteratorIterator(
[485] Fix | Delete
$directoryIterator,
[486] Fix | Delete
RecursiveIteratorIterator::CHILD_FIRST
[487] Fix | Delete
);
[488] Fix | Delete
$filtered = new CallbackFilterIterator(
[489] Fix | Delete
$contents,
[490] Fix | Delete
function (SplFileInfo $current) use ($group, $prefix) {
[491] Fix | Delete
if (!$current->isFile()) {
[492] Fix | Delete
return false;
[493] Fix | Delete
}
[494] Fix | Delete
[495] Fix | Delete
$hasPrefix = $prefix === ''
[496] Fix | Delete
|| strpos($current->getBasename(), $prefix) === 0;
[497] Fix | Delete
if ($hasPrefix === false) {
[498] Fix | Delete
return false;
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function