* @param string $file Name of the file to read.
* @return string|bool The function returns the read data or false on failure.
*/
* @param string $file Name of the file to read.
* @return string|bool The function returns the read data or false on failure.
*/
* @param string $file Path to the file.
* @return array|bool the file contents in an array or false on failure.
*/
* @param string $file Path to the file.
* @return array|bool the file contents in an array or false on failure.
*/
* @param int $mode (optional) The file permissions as octal number, usually 0644.
* @return bool False upon failure.
*/
* @param int $mode (optional) The file permissions as octal number, usually 0644.
* @return bool False upon failure.
*/
* @param string $dir The new current directory.
* @return bool Returns true on success or false on failure.
*/
* @param string $dir The new current directory.
* @return bool Returns true on success or false on failure.
*/
* @param bool $recursive (optional) If set True changes file group recursively. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
* @param bool $recursive (optional) If set True changes file group recursively. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
* @param bool $recursive (optional) If set True changes file group recursively. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
* @param bool $recursive (optional) If set True changes file group recursively. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
* @param bool $recursive (optional) If set True changes file owner recursively. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
* @param bool $recursive (optional) If set True changes file owner recursively. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
* @param string $file Path to the file.
* @return string|bool Username of the user or false on error.
*/
* @param string $file Path to the file.
* @return string|bool Username of the user or false on error.
*/
- function getchmod($file) {
- return substr(decoct(@fileperms($file)),3);
+ public function getchmod($file) {
+ return substr( decoct( @fileperms( $file ) ), -3 );
- function copy($source, $destination, $overwrite = false, $mode = false) {
+ public function copy($source, $destination, $overwrite = false, $mode = false) {
if ( empty( $file ) ) // Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.
return false;
$file = str_replace( '\\', '/', $file ); // for win32, occasional problems deleting files otherwise
if ( empty( $file ) ) // Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.
return false;
$file = str_replace( '\\', '/', $file ); // for win32, occasional problems deleting files otherwise
- function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
- // safe mode fails with a trailing slash under certain PHP versions.
+ public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
+ // Safe mode fails with a trailing slash under certain PHP versions.