[Vtigercrm-commits] [vtiger-commits] r5544 - /vtigercrm/trunk/include/file.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Apr 27 23:27:43 EDT 2006


Author: saraj
Date: Thu Apr 27 21:27:39 2006
New Revision: 5544

Log:
logs entries inserted in all functions

Modified:
    vtigercrm/trunk/include/file.php

Modified: vtigercrm/trunk/include/file.php
==============================================================================
--- vtigercrm/trunk/include/file.php (original)
+++ vtigercrm/trunk/include/file.php Thu Apr 27 21:27:39 2006
@@ -32,6 +32,8 @@
 class File {
 	function File ($id='',$name='',$module='Notes')
 	{
+		global $log;
+		$log->debug("Entering File (".$id.",".$name.",".$module.") method ...");
 		$this->id = $id;
 		$this->name = $name;
 		$this->module = $module;
@@ -42,6 +44,7 @@
 		* All Rights Reserved.
 		* Contributor(s): SugarCRM Inc. */
 		$this->folder = '/'.UPLOAD_FOLDER;
+		$log->debug("Exiting File method ...");
 		/** END CONTRIBUTION */
 	}
 
@@ -50,6 +53,8 @@
 	*/
 	function Upload ($fieldname)
 	{
+		global $log;
+		$log->debug("Entering Upload (".$fieldname.") method ...");
 		global $root_directory;
 		/** BEGIN CONTRIBUTION
 		* Date: 09/08/04
@@ -59,6 +64,7 @@
 		global $upload_badext;
 		/** END CONTRIBUTION */
 		if (!isset ($_FILES[$fieldname]) || empty ($_FILES[$fieldname]['tmp_name'])) {
+			$log->debug("Exiting Upload method ...");
 			return true; // uploading an empty file can't fail...
 		}
 		$this->name = $_FILES[$fieldname]['name'];
@@ -81,7 +87,10 @@
 			if (!is_dir($this->folder))
 			{
 				if (mkdir($root_directory.$this->folder, 0755))
+				{
+					$log->debug("Exiting Upload method ...");
 					return move_uploaded_file($_FILES[$fieldname]['tmp_name'], $dest);
+				}
 				else
 				{
 					// how to handle such error ?
@@ -89,24 +98,32 @@
 				}
 			}
 		}
+		$log->debug("Exiting Upload method ...");
 		return true;
 	}
 
 
 	function SetID ($id)
 	{
+		global $log;
+		$log->debug("Entering SetID (".$id.") method ...");
 		global $root_directory;
 		if (empty ($this->name))
+		{	$log->debug("Exiting SetID method ...");
 			return;
+		}
 		if (empty ($id))
 			die ("id empty");
 		$this->id = $id;
 		$path = $root_directory.$this->folder;
 		rename ($path.$this->name,$path.$id.$this->name);
+		$log->debug("Exiting SetID method ...");
 	}
 
 	function URL ()
 	{
+		global $log;
+		$log->debug("Entering URL () method ...");
 		/** VTIGER CRM CONTRIBUTION BEGINS
 		*/
 		$web_root = $_SERVER['SERVER_NAME']. ":" .$_SERVER['SERVER_PORT'];
@@ -116,6 +133,7 @@
 		*/		
 
 		//global $site_URL;
+		$log->debug("Exiting URL method ...");
 		return $web_root.$this->folder.$this->id.rawurlencode($this->name);
 	}
 
@@ -126,7 +144,10 @@
 	* Contributor(s): SugarCRM Inc. */
 	function Delete ($old_file)
 	{
+		global $log;
+		$log->debug("Entering Delete (".$old_file.") method ...");
 		global $root_directory, $upload_dir;
+		$log->debug("Exiting Delete method ...");
 		return unlink($root_directory . "/" . $upload_dir . $old_file);
 	}
 	/* END CONTRIBUTION */





More information about the vtigercrm-commits mailing list