2005-10-03 04:48:00 +00:00
|
|
|
<?php
|
|
|
|
/* SVN FILE: $Id$ */
|
|
|
|
/**
|
|
|
|
* Convenience class for reading, writing and appending to files.
|
2005-12-27 03:33:44 +00:00
|
|
|
*
|
2005-10-03 04:48:00 +00:00
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
2007-02-02 10:39:45 +00:00
|
|
|
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
|
|
|
|
* Copyright 2005-2007, Cake Software Foundation, Inc.
|
2006-05-26 05:29:17 +00:00
|
|
|
* 1785 E. Sahara Avenue, Suite 490-204
|
|
|
|
* Las Vegas, Nevada 89104
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2005-12-23 21:57:26 +00:00
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2005-12-27 03:33:44 +00:00
|
|
|
* @filesource
|
2007-02-02 10:39:45 +00:00
|
|
|
* @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
|
|
|
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
2006-05-26 05:29:17 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs
|
2007-02-02 10:39:45 +00:00
|
|
|
* @since CakePHP(tm) v 0.2.9
|
2006-05-26 05:29:17 +00:00
|
|
|
* @version $Revision$
|
|
|
|
* @modifiedby $LastChangedBy$
|
|
|
|
* @lastmodified $Date$
|
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Included libraries.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
if (!class_exists('Object')) {
|
|
|
|
uses ('object');
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
if (!class_exists('Folder')) {
|
|
|
|
uses ('folder');
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
|
|
|
* Convenience class for reading, writing and appending to files.
|
|
|
|
*
|
2006-05-26 05:29:17 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
class File extends Object{
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2007-05-03 23:22:02 +00:00
|
|
|
* Folder object of the File
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-22 02:38:12 +00:00
|
|
|
* @var object
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2007-05-03 23:22:02 +00:00
|
|
|
var $Folder = null;
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
|
|
|
* Filename
|
|
|
|
*
|
|
|
|
* @var string
|
2007-05-22 02:38:12 +00:00
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
var $name = null;
|
2007-05-30 00:09:14 +00:00
|
|
|
/**
|
|
|
|
* file info
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
* @access public
|
|
|
|
*/
|
2007-08-05 16:47:03 +00:00
|
|
|
var $info = array();
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param string $path Path to file
|
|
|
|
* @param boolean $create Create file if it does not exist (if true)
|
|
|
|
* @param int $mode Mode to apply to the folder holding the file
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2007-05-14 12:23:25 +00:00
|
|
|
function __construct($path, $create = false, $mode = 0755) {
|
2006-05-26 05:29:17 +00:00
|
|
|
parent::__construct();
|
2007-05-27 00:30:43 +00:00
|
|
|
$this->Folder =& new Folder(dirname($path), $create, $mode);
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->name = basename($path);
|
|
|
|
if (!$this->exists()) {
|
|
|
|
if ($create === true) {
|
2007-05-27 00:30:43 +00:00
|
|
|
$this->safe();
|
2006-05-26 05:29:17 +00:00
|
|
|
if (!$this->create()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
|
|
|
* Return the contents of this File as a string.
|
|
|
|
*
|
|
|
|
* @return string Contents
|
2007-05-20 06:30:19 +00:00
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function read() {
|
2007-05-27 00:30:43 +00:00
|
|
|
$contents = file_get_contents($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $contents;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
|
|
|
* Append given data string to this File.
|
|
|
|
*
|
|
|
|
* @param string $data Data to write
|
|
|
|
* @return boolean Success
|
2007-05-20 06:30:19 +00:00
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function append($data) {
|
|
|
|
return $this->write($data, 'a');
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-12-27 03:33:44 +00:00
|
|
|
* Write given data to this File.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2006-05-26 05:29:17 +00:00
|
|
|
* @param string $data Data to write to this File.
|
|
|
|
* @param string $mode Mode of writing. {@link http://php.net/fwrite See fwrite()}.
|
2005-10-03 04:48:00 +00:00
|
|
|
* @return boolean Success
|
2007-05-20 06:30:19 +00:00
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function write($data, $mode = 'w') {
|
2007-05-27 00:30:43 +00:00
|
|
|
$file = $this->pwd();
|
2006-05-26 05:29:17 +00:00
|
|
|
if (!($handle = fopen($file, $mode))) {
|
2007-05-20 06:30:19 +00:00
|
|
|
trigger_error(sprintf(__("[File] Could not open %s with mode %s!", true), $file, $mode), E_USER_WARNING);
|
2006-05-26 05:29:17 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2007-05-27 00:30:43 +00:00
|
|
|
if (false === fwrite($handle, $data)) {
|
2006-05-26 05:29:17 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!fclose($handle)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2007-05-27 00:30:43 +00:00
|
|
|
/**
|
|
|
|
* makes filename safe for saving
|
|
|
|
*
|
|
|
|
* @param string $name the name of the file to make safe if different from $this->name
|
|
|
|
* @return string $ext the extension of the file
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function safe($name = null, $ext = null) {
|
2007-06-20 06:15:35 +00:00
|
|
|
if (!$name) {
|
2007-05-27 00:30:43 +00:00
|
|
|
$name = $this->name;
|
|
|
|
}
|
2007-06-20 06:15:35 +00:00
|
|
|
if (!$ext) {
|
2007-05-27 00:30:43 +00:00
|
|
|
$ext = $this->ext();
|
|
|
|
}
|
|
|
|
return preg_replace( "/[^\w\.-]+/", "_", basename($name, $ext));
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
|
|
|
* Get md5 Checksum of file with previous check of Filesize
|
|
|
|
*
|
2006-05-26 05:29:17 +00:00
|
|
|
* @param string $force Data to write to this File.
|
2005-10-03 04:48:00 +00:00
|
|
|
* @return string md5 Checksum {@link http://php.net/md5_file See md5_file()}
|
2007-05-20 06:30:19 +00:00
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2007-05-27 00:30:43 +00:00
|
|
|
function md5($force = false) {
|
2006-05-26 05:29:17 +00:00
|
|
|
$md5 = '';
|
2007-05-27 00:30:43 +00:00
|
|
|
if ($force == true || $this->size(false) < MAX_MD5SIZE) {
|
|
|
|
$md5 = md5_file($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
}
|
|
|
|
return $md5;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns the Filesize, either in bytes or in human-readable format.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2006-05-26 05:29:17 +00:00
|
|
|
* @param boolean $humanReadeble Data to write to this File.
|
2005-10-18 22:27:39 +00:00
|
|
|
* @return string|int filesize as int or as a human-readable string
|
2007-05-20 06:30:19 +00:00
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2007-05-27 00:30:43 +00:00
|
|
|
function size() {
|
|
|
|
$size = filesize($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $size;
|
|
|
|
}
|
2007-05-27 16:06:49 +00:00
|
|
|
/**
|
|
|
|
* Returns the File extension.
|
|
|
|
*
|
|
|
|
* @return string The File extension
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function info() {
|
2007-06-20 06:15:35 +00:00
|
|
|
if ($this->info == null) {
|
2007-05-30 00:09:14 +00:00
|
|
|
$this->info = pathinfo($this->pwd());
|
|
|
|
}
|
2007-06-20 06:15:35 +00:00
|
|
|
if (!isset($this->info['filename'])) {
|
2007-08-21 03:39:02 +00:00
|
|
|
$this->info['filename'] = $this->name();
|
2007-05-29 23:38:36 +00:00
|
|
|
}
|
2007-05-30 00:09:14 +00:00
|
|
|
return $this->info;
|
2007-05-29 23:38:36 +00:00
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns the File extension.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return string The File extension
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2007-05-27 00:30:43 +00:00
|
|
|
function ext() {
|
2007-06-20 06:15:35 +00:00
|
|
|
if ($this->info == null) {
|
2007-05-30 00:09:14 +00:00
|
|
|
$this->info();
|
|
|
|
}
|
2007-06-20 06:15:35 +00:00
|
|
|
if (isset($this->info['extension'])) {
|
2007-05-30 00:09:14 +00:00
|
|
|
return $this->info['extension'];
|
2006-05-26 05:29:17 +00:00
|
|
|
}
|
2007-05-27 16:06:49 +00:00
|
|
|
return false;
|
2006-05-26 05:29:17 +00:00
|
|
|
}
|
2007-05-27 16:06:49 +00:00
|
|
|
/**
|
|
|
|
* Returns the File name without extension.
|
|
|
|
*
|
|
|
|
* @return string The File name without extension.
|
|
|
|
* @access public
|
|
|
|
*/
|
2007-08-21 03:39:02 +00:00
|
|
|
function name() {
|
2007-06-20 06:15:35 +00:00
|
|
|
if ($this->info == null) {
|
2007-05-30 00:09:14 +00:00
|
|
|
$this->info();
|
|
|
|
}
|
2007-06-20 06:15:35 +00:00
|
|
|
if (isset($this->info['extension'])) {
|
2007-05-30 00:09:14 +00:00
|
|
|
return basename($this->name, '.'.$this->info['extension']);
|
2007-05-27 16:06:49 +00:00
|
|
|
}
|
|
|
|
return false;
|
2007-05-29 23:38:36 +00:00
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns the File's owner.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
|
|
|
* @return int the Fileowner
|
|
|
|
*/
|
2007-05-27 00:30:43 +00:00
|
|
|
function owner() {
|
|
|
|
$fileowner = fileowner($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $fileowner;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns the File group.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
|
|
|
* @return int the Filegroup
|
2007-05-20 06:30:19 +00:00
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2007-05-27 00:30:43 +00:00
|
|
|
function group() {
|
|
|
|
$filegroup = filegroup($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $filegroup;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Creates the File.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2005-10-18 22:27:39 +00:00
|
|
|
* @return boolean Success
|
2007-05-20 06:30:19 +00:00
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function create() {
|
2007-05-03 23:22:02 +00:00
|
|
|
$dir = $this->Folder->pwd();
|
2006-05-26 05:29:17 +00:00
|
|
|
|
|
|
|
if (file_exists($dir) && is_dir($dir) && is_writable($dir) && !$this->exists()) {
|
2007-05-27 00:30:43 +00:00
|
|
|
if (!touch($this->pwd())) {
|
|
|
|
print (sprintf(__('[File] Could not create %s', true), $this->name));
|
2006-05-26 05:29:17 +00:00
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
} else {
|
2007-05-27 00:30:43 +00:00
|
|
|
print (sprintf(__('[File] Could not create %s', true), $this->name));
|
2006-05-26 05:29:17 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns true if the File exists.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return boolean true if it exists, false otherwise
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function exists() {
|
2007-05-27 00:30:43 +00:00
|
|
|
$exists = (file_exists($this->pwd()) && is_file($this->pwd()));
|
2006-05-26 05:29:17 +00:00
|
|
|
return $exists;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Deletes the File.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return boolean Success
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function delete() {
|
2007-05-27 00:30:43 +00:00
|
|
|
$unlink = unlink($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $unlink;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns true if the File is writable.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return boolean true if its writable, false otherwise
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function writable() {
|
2007-05-27 00:30:43 +00:00
|
|
|
$writable = is_writable($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $writable;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns true if the File is executable.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return boolean true if its executable, false otherwise
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function executable() {
|
2007-05-27 00:30:43 +00:00
|
|
|
$executable = is_executable($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $executable;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns true if the File is readable.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return boolean true if file is readable, false otherwise
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function readable() {
|
2007-05-27 00:30:43 +00:00
|
|
|
$readable = is_readable($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $readable;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns last access time.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return int timestamp Timestamp of last access time
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function lastAccess() {
|
2007-05-27 00:30:43 +00:00
|
|
|
$fileatime = fileatime($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $fileatime;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns last modified time.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return int timestamp Timestamp of last modification
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function lastChange() {
|
2007-05-27 00:30:43 +00:00
|
|
|
$filemtime = filemtime($this->pwd());
|
2006-05-26 05:29:17 +00:00
|
|
|
return $filemtime;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns the current folder.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return Folder Current folder
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2007-05-27 00:30:43 +00:00
|
|
|
function &Folder() {
|
2007-05-03 23:22:02 +00:00
|
|
|
return $this->Folder;
|
2006-05-26 05:29:17 +00:00
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
* Returns the "chmod" (permissions) of the File.
|
2005-10-03 04:48:00 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @return string Permissions for the file
|
|
|
|
* @access public
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2007-05-27 00:30:43 +00:00
|
|
|
function perms() {
|
|
|
|
$substr = substr(sprintf('%o', fileperms($this->pwd())), -4);
|
2006-05-26 05:29:17 +00:00
|
|
|
return $substr;
|
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
/**
|
2007-05-27 00:30:43 +00:00
|
|
|
* Returns the full path of the File.
|
|
|
|
*
|
|
|
|
* @return string Full path to file
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function pwd() {
|
|
|
|
return $this->Folder->slashTerm($this->Folder->pwd()) . $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Deprecated methods */
|
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
* @see File::pwd
|
2005-10-03 04:48:00 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function getFullPath() {
|
2007-08-21 03:39:02 +00:00
|
|
|
trigger_error('Deprecated: Use File::pwd() instead.', E_USER_WARNING);
|
2007-05-27 00:30:43 +00:00
|
|
|
return $this->pwd();
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
* @see File::name
|
|
|
|
*/
|
|
|
|
function getName() {
|
2007-08-21 03:39:02 +00:00
|
|
|
trigger_error('Deprecated: Use File::name() instead.', E_USER_WARNING);
|
2007-05-27 00:30:43 +00:00
|
|
|
return $this->name;
|
|
|
|
}
|
2007-08-21 03:39:02 +00:00
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
* @see File::name()
|
|
|
|
*/
|
|
|
|
function filename() {
|
|
|
|
trigger_error('Deprecated: Use File::name() instead.', E_USER_WARNING);
|
|
|
|
return $this->name();
|
|
|
|
}
|
2007-05-27 00:30:43 +00:00
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
* @see File::ext()
|
|
|
|
*/
|
|
|
|
function getExt() {
|
2007-08-21 03:39:02 +00:00
|
|
|
trigger_error('Deprecated: Use File::ext() instead.', E_USER_WARNING);
|
2007-05-27 00:30:43 +00:00
|
|
|
return $this->ext();
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @deprecated
|
2007-08-21 03:39:02 +00:00
|
|
|
* @see File::md5()
|
2007-05-27 00:30:43 +00:00
|
|
|
*/
|
|
|
|
function getMd5() {
|
2007-08-21 03:39:02 +00:00
|
|
|
trigger_error('Deprecated: Use File::md5() instead.', E_USER_WARNING);
|
2007-05-27 00:30:43 +00:00
|
|
|
return $this->md5();
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
* @see File::size()
|
|
|
|
*/
|
|
|
|
function getSize() {
|
2007-08-21 03:39:02 +00:00
|
|
|
trigger_error('Deprecated: Use File::size() instead.', E_USER_WARNING);
|
2007-05-27 00:30:43 +00:00
|
|
|
return $this->size();
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
* @see File::owner()
|
|
|
|
*/
|
|
|
|
function getOwner() {
|
2007-08-21 03:39:02 +00:00
|
|
|
trigger_error('Deprecated: Use File::owner() instead.', E_USER_WARNING);
|
2007-05-27 00:30:43 +00:00
|
|
|
return $this->owner();
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
* @see File::group()
|
|
|
|
*/
|
|
|
|
function getGroup() {
|
2007-08-21 03:39:02 +00:00
|
|
|
trigger_error('Deprecated: Use File::group() instead.', E_USER_WARNING);
|
2007-05-27 00:30:43 +00:00
|
|
|
return $this->group();
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
* @see File::perms()
|
|
|
|
*/
|
|
|
|
function getChmod() {
|
2007-08-21 03:39:02 +00:00
|
|
|
trigger_error('Deprecated: Use File::perms() instead.', E_USER_WARNING);
|
2007-05-27 00:30:43 +00:00
|
|
|
return $this->perms();
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
* @see File::Folder()
|
|
|
|
*/
|
|
|
|
function getFolder() {
|
2007-08-21 03:39:02 +00:00
|
|
|
trigger_error('Deprecated: Use File::Folder() instead.', E_USER_WARNING);
|
2007-05-27 00:30:43 +00:00
|
|
|
return $this->Folder();
|
2006-05-26 05:29:17 +00:00
|
|
|
}
|
2005-10-03 04:48:00 +00:00
|
|
|
}
|
2005-12-27 03:33:44 +00:00
|
|
|
?>
|