1 | <?php |
---|
2 | /**************************************************************************\ |
---|
3 | * eGroupWare * |
---|
4 | * http://www.egroupware.org * |
---|
5 | * -------------------------------------------- * |
---|
6 | * This program is free software; you can redistribute it and/or modify it * |
---|
7 | * under the terms of the GNU General Public License as published by the * |
---|
8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
9 | * option) any later version. * |
---|
10 | \**************************************************************************/ |
---|
11 | |
---|
12 | /** |
---|
13 | * Specialization of the BaseFactory class. |
---|
14 | * This class is used to instantiate classes for |
---|
15 | * processes. You cannot access this class directly, |
---|
16 | * but requests to the Factory frontend class in |
---|
17 | * 'secured mode' will be forwarded to this class. |
---|
18 | * It should be much more restrictive than its |
---|
19 | * older brother (or sister), WorkflowFactory... |
---|
20 | * |
---|
21 | * @package Factory |
---|
22 | * @license http://www.gnu.org/copyleft/gpl.html GPL |
---|
23 | * @author Pedro Eugênio Rocha - pedro.eugenio.rocha@gmail.com |
---|
24 | */ |
---|
25 | final class ProcessFactory extends BaseFactory { |
---|
26 | |
---|
27 | |
---|
28 | /** |
---|
29 | * @var boolean $_instantiated Attribute that stores whether this |
---|
30 | * class was instantiated or not. This is used to limit the |
---|
31 | * instantiation of this class. |
---|
32 | * @access private |
---|
33 | * @static |
---|
34 | */ |
---|
35 | private static $_instantiated = false; |
---|
36 | |
---|
37 | /** |
---|
38 | * Construct the class. This function will inform which classes |
---|
39 | * you will be able to instantiate and where to find it. |
---|
40 | * This function implements a kind of singleton design pattern too. |
---|
41 | * @access public |
---|
42 | */ |
---|
43 | public function __construct() { |
---|
44 | |
---|
45 | /* don't let the user to instantiate this class more than once. */ |
---|
46 | if (self::$_instantiated) |
---|
47 | throw new Exception("You can't instantiate this class again."); |
---|
48 | |
---|
49 | /* registering allowed classes */ |
---|
50 | $this->registerFileInfo('wf_cached_ldap', 'class.wf_cached_ldap.php', 'inc/local/classes'); |
---|
51 | $this->registerFileInfo('wf_crypt', 'class.wf_crypt.php', 'inc/local/classes'); |
---|
52 | $this->registerFileInfo('wf_date', 'class.wf_date.php', 'inc/local/classes'); |
---|
53 | $this->registerFileInfo('wf_db', 'class.wf_db.php', 'inc/local/classes'); |
---|
54 | $this->registerFileInfo('wf_engine', 'class.wf_engine.php', 'inc/local/classes'); |
---|
55 | $this->registerFileInfo('wf_fpdf', 'class.wf_fpdf.php', 'inc/local/classes'); |
---|
56 | $this->registerFileInfo('wf_instance', 'class.wf_instance.php', 'inc/local/classes'); |
---|
57 | $this->registerFileInfo('wf_ldap', 'class.wf_ldap.php', 'inc/local/classes'); |
---|
58 | $this->registerFileInfo('wf_location', 'class.wf_location.php', 'inc/local/classes'); |
---|
59 | $this->registerFileInfo('wf_log', 'class.wf_log.php', 'inc/local/classes'); |
---|
60 | $this->registerFileInfo('wf_mail', 'class.wf_mail.php', 'inc/local/classes'); |
---|
61 | $this->registerFileInfo('wf_mem_image', 'class.wf_mem_image.php', 'inc/local/classes'); |
---|
62 | $this->registerFileInfo('wf_natural', 'class.wf_natural.php', 'inc/local/classes'); |
---|
63 | $this->registerFileInfo('wf_orgchart', 'class.wf_orgchart.php', 'inc/local/classes'); |
---|
64 | $this->registerFileInfo('wf_paging', 'class.wf_paging.php', 'inc/local/classes'); |
---|
65 | $this->registerFileInfo('wf_phplot', 'class.wf_phplot.php', 'inc/local/classes'); |
---|
66 | $this->registerFileInfo('wf_regex', 'class.wf_regex.php', 'inc/local/classes'); |
---|
67 | $this->registerFileInfo('wf_role', 'class.wf_role.php', 'inc/local/classes'); |
---|
68 | $this->registerFileInfo('wf_string', 'class.wf_string.php', 'inc/local/classes'); |
---|
69 | $this->registerFileInfo('wf_type', 'class.wf_type.php', 'inc/local/classes'); |
---|
70 | $this->registerFileInfo('wf_url', 'class.wf_url.php', 'inc/local/classes'); |
---|
71 | $this->registerFileInfo('wf_util', 'class.wf_util.php', 'inc/local/classes'); |
---|
72 | $this->registerFileInfo('wf_workitem', 'class.wf_workitem.php', 'inc/local/classes'); |
---|
73 | |
---|
74 | /* ok. no more instances of this class.. */ |
---|
75 | self::$_instantiated = true; |
---|
76 | } |
---|
77 | } |
---|
78 | ?> |
---|