Skip to content

Commit

Permalink
Clarify octal input instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Sep 10, 2014
1 parent 3e25282 commit eedefb9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/Cake/Utility/Folder.php
Expand Up @@ -368,11 +368,11 @@ public function inPath($path = '', $reverse = false) {
/**
* Change the mode on a directory structure recursively. This includes changing the mode on files as well.
*
* @param string $path The path to chmod
* @param int $mode octal value 0755
* @param bool $recursive chmod recursively, set to false to only change the current directory.
* @param array $exceptions array of files, directories to skip
* @return bool Returns TRUE on success, FALSE on failure
* @param string $path The path to chmod.
* @param int $mode Octal value, e.g. 0755.
* @param bool $recursive Chmod recursively, set to false to only change the current directory.
* @param array $exceptions Array of files, directories to skip.
* @return bool Success.
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::chmod
*/
public function chmod($path, $mode = false, $recursive = true, $exceptions = array()) {
Expand All @@ -382,7 +382,7 @@ public function chmod($path, $mode = false, $recursive = true, $exceptions = arr

if ($recursive === false && is_dir($path)) {
//@codingStandardsIgnoreStart
if (@chmod($path, intval((string)$mode, 8))) {
if (@chmod($path, intval($mode, 8))) {
//@codingStandardsIgnoreEnd
$this->_messages[] = __d('cake_dev', '%s changed to %s', $path, $mode);
return true;
Expand All @@ -405,7 +405,7 @@ public function chmod($path, $mode = false, $recursive = true, $exceptions = arr
}

//@codingStandardsIgnoreStart
if (@chmod($fullpath, intval((string)$mode, 8))) {
if (@chmod($fullpath, intval($mode, 8))) {
//@codingStandardsIgnoreEnd
$this->_messages[] = __d('cake_dev', '%s changed to %s', $fullpath, $mode);
} else {
Expand Down Expand Up @@ -628,12 +628,12 @@ public function delete($path = null) {
*
* - `to` The directory to copy to.
* - `from` The directory to copy from, this will cause a cd() to occur, changing the results of pwd().
* - `mode` The mode to copy the files/directories with.
* - `mode` The mode to copy the files/directories with, e.g. 0775.
* - `skip` Files/directories to skip.
* - `scheme` Folder::MERGE, Folder::OVERWRITE, Folder::SKIP
*
* @param array|string $options Either an array of options (see above) or a string of the destination directory.
* @return bool Success
* @return bool Success.
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::copy
*/
public function copy($options) {
Expand Down Expand Up @@ -681,7 +681,7 @@ public function copy($options) {
$from = Folder::addPathElement($fromDir, $item);
if (is_file($from) && (!is_file($to) || $options['scheme'] != Folder::SKIP)) {
if (copy($from, $to)) {
chmod($to, intval((string)$mode, 8));
chmod($to, intval($mode, 8));
touch($to, filemtime($from));
$this->_messages[] = __d('cake_dev', '%s copied to %s', $from, $to);
} else {
Expand Down

0 comments on commit eedefb9

Please sign in to comment.