Source for file Files.class.php
Documentation is available at Files.class.php
* For including this file you have to define the constant "CLASSPATH".
* Because every include in the framework depends on the CLASSPATH definition.
* The CLASSPATH means the relative path to the folder that contains the
echo "<h3>You have to define the constant CLASSPATH!</h3>\r\n";
echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\r\n";
include_once( CLASSPATH. "filesystem/FilesystemToolkit.class.php" );
* A class to manage files in a filesystemtree.
* @author Daniel Plücken <daniel@debakel.net>
* @license http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
* @copyright Copyright (c) 2003 Daniel Plücken <daniel@debakel.net>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
* @var Folder $parentfolder
* Is set if the function saveTmp() has been invoke.
* @author Daniel Plücken <daniel@debakel.net>
* @param string $path_and_filename
* @param string $filename
* Compares the given Files object with this one. If both equal each other it
* will be returned true, otherwise false. The two file objects will be
* accounted as equal, if the the filenames and pathes match each other.
* @author Daniel Plücken <daniel@debakel.net>
* @param ImageFiles $img_obj
return $this->filename == $img_obj->filename
&& $this->path == $img_obj->path;
* Returns the path to the file of this file object.
* @author Daniel Plücken <daniel@debakel.net>
* Returns the filename of this file object.
* @author Daniel Plücken <daniel@debakel.net>
* Returns the file extension of the given filename.
* @author Daniel Plücken <daniel@debakel.net>
* Returns the content of this file object.
* @author Daniel Plücken <daniel@debakel.net>
* Returns the content of this file object. This function is an alias for
* the function getContent().
* @author Daniel Plücken <daniel@debakel.net>
* Sets the parent folder of this file object that there is a back reference
* up to the root of the filesystem tree,
* @author Daniel Plücken <daniel@debakel.net>
* @param Folder $objRef The reference to the folder object that
* Sets the content of this file object.
* @author Daniel Plücken <daniel@debakel.net>
* @param string $string The content which should be set to the file.
* Sets the content of this file object.
* @author Daniel Plücken <daniel@debakel.net>
* @param integer $filesize The size of this file to be set.
* Sets the content of this file object.
* @author Daniel Plücken <daniel@debakel.net>
* Loads the content of this file object from the filesystem and sets
* the content to this object.
* @author Daniel Plücken <daniel@debakel.net>
* Saves the file of this object with given name.
* You need to give in the filename at least.
* @author Daniel Plücken <daniel@debakel.net>
* @param string $path Where the file should be stored.
* @param string $file Which name the file should get.
echo 'You have to give a filename at least.\n<br>';
fopen( $path. "/". $file, 'w' ),
* Saves the file of this object.
* @author Daniel Plücken <daniel@debakel.net>
* Saves the file of this object in a temporary file.
* Deletes the temporary file of this object.
* @author Daniel Plücken <daniel@debakel.net>
|