Location: PHPKode > scripts > Size > size/size.class.php
<?php

/****************************************************************
*****************************************************************

class_log.php: create to get informations about disk sizes.
Copyright (C) 2003  Enéas Gesing hide@address.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

You can found more information about GPL licence at:
http://www.gnu.org/licenses/gpl.html

for contact me: hide@address.com
****************************************************************
****************************************************************/
/**
 * create the : november 19th 2005.
 * @author      Enéas GESING
 * @version     1.0.0
 * @since       1.0.0
 */

class size {

    /**
	* builder
	**/

	function size($path){
	}//size builder

	/**
	* function that returns the total size of specified path
	* for local drives (Windows), use parameter "C:", for example.
	* @param string $path, required. the directory or drive to get total size in bytes
	* @public
	* @type float
	**/
	
	function total_size($path){
		$size = disk_total_space($path);
		return $size;
	}//total_size method
	
	
	/**
	* function that returns the free space on a specified path
	* for local drives (Windows), use parameter "C:", for example.
	* @param string $path, required. the directory or drive to get total size in bytes
	* @public
	* @type float
	**/
	
	function free_space($path){
		$free_space = disk_free_space($path);
		return $free_space;
	}//free_space method
	
	
	/**
	* function that returns the used space of specified path
	* for local drives (Windows), use parameter "C:", for example.
	* @param string $path, required. the directory or drive to get total size in bytes
	* @public
	* @type float
	**/
	
	function used_space($path){
		$used_space = ($this->total_size($path))-($this->free_space($path));
		return $used_space;
	}//free_space method

}//size class

?>
Return current item: Size