"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Filesystem/File.php" between
cakephp-4.0.1.tar.gz and cakephp-4.0.2.tar.gz

About: CakePHP is a rapid development framework for PHP applications. Source code.

File.php  (cakephp-4.0.1):File.php  (cakephp-4.0.2)
skipping to change at line 146 skipping to change at line 146
} }
$this->handle = fopen($this->path, $mode); $this->handle = fopen($this->path, $mode);
return is_resource($this->handle); return is_resource($this->handle);
} }
/** /**
* Return the contents of this file as a string. * Return the contents of this file as a string.
* *
* @param string|bool $bytes where to start * @param string|false $bytes where to start
* @param string $mode A `fread` compatible mode. * @param string $mode A `fread` compatible mode.
* @param bool $force If true then the file will be re-opened even if its al ready opened, otherwise it won't * @param bool $force If true then the file will be re-opened even if its al ready opened, otherwise it won't
* @return string|bool string on success, false on failure * @return string|false String on success, false on failure
*/ */
public function read($bytes = false, string $mode = 'rb', bool $force = fals e) public function read($bytes = false, string $mode = 'rb', bool $force = fals e)
{ {
if ($bytes === false && $this->lock === null) { if ($bytes === false && $this->lock === null) {
return file_get_contents($this->path); return file_get_contents($this->path);
} }
if ($this->open($mode, $force) === false) { if ($this->open($mode, $force) === false) {
return false; return false;
} }
if ($this->lock !== null && flock($this->handle, LOCK_SH) === false) { if ($this->lock !== null && flock($this->handle, LOCK_SH) === false) {
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)