Ignore:
Timestamp:
03/12/10 10:59:32 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Migração das classes do módulo workflow para a nova factory.

Location:
sandbox/workflow/branches/609/lib/factory
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/branches/609/lib/factory/BaseFactory.php

    r2222 r2233  
    154154                /* not found */ 
    155155                if (!($entry = $this->_getEntry($className))) 
    156                         throw new Exception('You are not allowed to instantiate '.$className.' class.'); 
     156                        throw new Exception('You are not allowed to instantiate \''.$className.'\' class.'); 
    157157 
    158                 $fullPath = $entry['basePath'] . SEP . $entry['path'] . SEP . $entry['filename']; 
     158                $fullPath = $entry['basePath'] . '/' . $entry['path'] . '/' . $entry['filename']; 
    159159 
    160160                /* file not found */ 
  • sandbox/workflow/branches/609/lib/factory/Factory.php

    r2223 r2233  
    6464         * @static 
    6565         */ 
    66         public static function getInstance() { 
     66        public static function &getInstance() { 
    6767 
    6868                /* oops. we are in the process space. */ 
     
    9393         * Just forward this call to the correct class. 
    9494         * 
    95          * @todo I must implement it! 
    9695         * @access public 
    9796         * @retun object 
    9897         * @static 
    9998         */ 
    100         public static function newInstance() { 
     99        public static function &newInstance() { 
     100 
     101                /* oops. we are in the process space. */ 
     102                if (Security::isEnabled()) { 
     103 
     104                        /* must instatiate it */ 
     105                        if (is_null(self::$_securedFactory)) 
     106                                self::$_securedFactory = new ProcessFactory(); 
     107 
     108                        $args = func_get_args(); 
     109                        return call_user_func_array(array(self::$_securedFactory, "newInstance"), $args); 
     110 
     111                } 
     112                /* regular module space */ 
     113                else { 
     114 
     115                        /* must instatiate it */ 
     116                        if (is_null(self::$_unsecuredFactory)) 
     117                                self::$_unsecuredFactory = new WorkflowFactory(); 
     118 
     119                        $args = func_get_args(); 
     120                        return call_user_func_array(array(self::$_unsecuredFactory, "newInstance"), $args); 
     121                } 
    101122        } 
    102123} 
  • sandbox/workflow/branches/609/lib/factory/WorkflowFactory.php

    r2223 r2233  
    4949                /* registering allowed classes */ 
    5050                $this->registerFileInfo('WorkflowObjects', 'class.WorkflowObjects.inc.php', 'inc'); 
     51                $this->registerFileInfo('WorkflowWatcher', 'class.WorkflowWatcher.inc.php', 'inc'); 
     52                $this->registerFileInfo('WorkflowLDAP', 'class.WorkflowLDAP.inc.php', 'inc'); 
     53                $this->registerFileInfo('WorkflowSecurity', 'class.WorkflowSecurity.inc.php', 'inc'); 
     54                $this->registerFileInfo('ResourcesRedirector', 'class.ResourcesRedirector.inc.php', 'inc'); 
    5155                $this->registerFileInfo('TemplateServer', 'class.TemplateServer.inc.php', 'inc'); 
     56                $this->registerFileInfo('CachedLDAP', 'class.CachedLDAP.inc.php', 'inc'); 
     57                $this->registerFileInfo('BrowserInfo', 'class.BrowserInfo.inc.php', 'inc'); 
     58 
    5259                $this->registerFileInfo('workflow_smarty', 'class.workflow_smarty.inc.php', 'inc'); 
     60                $this->registerFileInfo('workflow_acl', 'class.workflow_acl.inc.php', 'inc'); 
     61                $this->registerFileInfo('workflow_processmanager', 'class.workflow_processmanager.inc.php', 'inc'); 
     62 
     63                $this->registerFileInfo('bo_participants', 'class.bo_participants.inc.php', 'inc'); 
    5364 
    5465                /* registering egw class example */ 
    55                 //$this->registerFileInfo('db', 'x', 'inc', PHPGW_API_INC); 
     66                $this->registerFileInfo('phpgw', 'class.phpgw.inc.php', '', EGW_INC_ROOT); 
     67                $this->registerFileInfo('db', 'class.db.inc.php', '', EGW_INC_ROOT); 
     68                $this->registerFileInfo('accounts', 'class.accounts.inc.php', '', EGW_INC_ROOT); 
    5669 
    5770                /* ok. no more instances of this class.. */ 
Note: See TracChangeset for help on using the changeset viewer.