phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/inc common_functions.inc.php


From: Dave Hall
Subject: [Phpgroupware-cvs] phpgwapi/inc common_functions.inc.php
Date: Fri, 22 Sep 2006 03:03:50 +0000

CVSROOT:        /cvsroot/phpgwapi
Module name:    phpgwapi
Changes by:     Dave Hall <skwashd>     06/09/22 03:03:50

Modified files:
        inc            : common_functions.inc.php 

Log message:
        streamline and errors

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/common_functions.inc.php?cvsroot=phpgwapi&r1=1.24&r2=1.25

Patches:
Index: common_functions.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/common_functions.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- common_functions.inc.php    3 Sep 2006 11:14:42 -0000       1.24
+++ common_functions.inc.php    22 Sep 2006 03:03:50 -0000      1.25
@@ -8,7 +8,7 @@
  * @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General Public 
License
  * @package phpgwapi
  * @subpackage utilities
- * @version $Id: common_functions.inc.php,v 1.24 2006/09/03 11:14:42 skwashd 
Exp $
+ * @version $Id: common_functions.inc.php,v 1.25 2006/09/22 03:03:50 skwashd 
Exp $
  */
 
        /*
@@ -458,9 +458,7 @@
        /**
         * This will include an application class once and guarantee that it is 
loaded only once.  Similar to CreateObject, but does not instantiate the class.
         *
-        * @author dschaller
-        * This will include an application class once and guarantee that it is 
loaded only once.  Similar to CreateObject, but does not instantiate the class.
-        * include_class('projects.ui_base');
+        * @example include_class('projects.ui_base');
         * @param $appName name of application
         * @param $className name of class
         * @param $classPath path to the application class, default is 'inc/', 
use this parameter i.e. if the class is located in a subdirectory like 
'inc/base_classes/'
@@ -468,29 +466,18 @@
         */
        function include_class($appName, $className, $classPath='inc/')
        {
-               $fileName = PHPGW_INCLUDE_ROOT . 
"/{$appName}/{$classPath}class.{$className}.inc.php";
-               if (!isset($included_files[$fileName]))
-               {
-                       if(@file_exists($fileName))
+               if ( is_file(PHPGW_INCLUDE_ROOT . 
"/{$appName}/{$classPath}class.{$className}.inc.php") )
                        {
-                               include_once($fileName);
-                               $is_included = True;
+                       return include_once(PHPGW_INCLUDE_ROOT . 
"/{$appName}/{$classPath}class.{$className}.inc.php");
                        }
-                       else
-                       {
-                               $is_included = False;
-                       }
-               }
-               else
-               {
-                       $is_included = True;
-               }
-
-               return $is_included;
+               return false;
        }
 
-       // include object factory base class once               
+       /**
+       * include object factory base class once                
+       */
        
include_once(PHPGW_SERVER_ROOT.'/phpgwapi/inc/class.object_factory.inc.php');
+
        /**
         * delegate the object creation into the module.
         *




reply via email to

[Prev in Thread] Current Thread [Next in Thread]