| 13 | | <sect1> |
|---|
| 14 | | <title>Run time mode</title> |
|---|
| 15 | | <para> |
|---|
| 16 | | The Jaws core object is initiated in a specific run time mode. Here is the |
|---|
| 17 | | list of available modes: |
|---|
| 18 | | </para> |
|---|
| 19 | | <para> |
|---|
| 20 | | <itemizedlist> |
|---|
| 21 | | <listitem> |
|---|
| 22 | | <constant>Jaws::MODE_WEB</constant> - Mode used by web applications |
|---|
| 23 | | </listitem> |
|---|
| 24 | | |
|---|
| 25 | | <listitem> |
|---|
| 26 | | <constant>Jaws::MODE_CONSOLE</constant> - Mode used by console applications |
|---|
| 27 | | </listitem> |
|---|
| 28 | | |
|---|
| 29 | | <listitem> |
|---|
| 30 | | <constant>Jaws::MODE_STRIP</constant> - Minimalist mode. Used by |
|---|
| 31 | | configuration utilities |
|---|
| 32 | | </listitem> |
|---|
| 33 | | </itemizedlist> |
|---|
| 34 | | </para> |
|---|
| 35 | | |
|---|
| 36 | | <para> |
|---|
| 37 | | The mode must be specified as an argument to the <function>Jaws::init</function> |
|---|
| 38 | | method. The configuration and fine tuning of the subsystem loading process is |
|---|
| 39 | | done through a configuration array available in file |
|---|
| 40 | | <filename>api/Jaws/Subsystem/CnfArray.php</filename>. The array is in the form: |
|---|
| 41 | | </para> |
|---|
| 42 | | |
|---|
| 43 | | <para> |
|---|
| 44 | | <example> |
|---|
| 45 | | <programlisting role="php"> |
|---|
| 46 | | <![CDATA[ |
|---|
| 47 | | $subsystems = array( |
|---|
| 48 | | 'ShortName' => array('name' => 'Description of the subsystem', |
|---|
| 49 | | 'class' => 'Jaws_Subsystem', |
|---|
| 50 | | 'modes' => Jaws::MODE_WEB | Jaws::MODE_CONSOLE |
|---|
| 51 | | ), |
|---|
| 52 | | ... |
|---|
| 53 | | ); |
|---|
| 54 | | ]]> |
|---|
| 55 | | </programlisting> |
|---|
| 56 | | </example> |
|---|
| 57 | | </para> |
|---|
| 58 | | |
|---|
| 59 | | <para> |
|---|
| 60 | | The key is the name with which the subsystem will be accessed |
|---|
| 61 | | (<varname>Jaws::$Name</varname>). Modes can be one or many modes in which |
|---|
| 62 | | the subsystem should be loaded. If the subsystem should be loaded in all |
|---|
| 63 | | modes, the <constant>Jaws::MODE_ALL</constant> constant can |
|---|
| 64 | | be used. |
|---|
| 65 | | </para> |
|---|
| 66 | | |
|---|
| 67 | | <para> |
|---|
| 68 | | It is also important to note that subsystems are loaded in the order they appear in the configuration array. |
|---|
| 69 | | </para> |
|---|
| 70 | | </sect1> |
|---|
| 71 | | |
|---|
| 72 | | <sect1> |
|---|
| 73 | | <title>Methods</title> |
|---|
| 74 | | <sect2> |
|---|
| 75 | | <title><function>Jaws::init</function></title> |
|---|
| 76 | | |
|---|
| 77 | | <methodsynopsis> |
|---|
| 78 | | <type>void</type><methodname>Jaws::init</methodname> |
|---|
| 79 | | <methodparam><type>integer</type><parameter>mode</parameter></methodparam> |
|---|
| 80 | | <methodparam choice="opt"><type>array</type><parameter>subsystems</parameter></methodparam> |
|---|
| 81 | | </methodsynopsis> |
|---|
| 82 | | |
|---|
| 83 | | <para> |
|---|
| 84 | | This method initializes the Jaws abstract object and should be called by the |
|---|
| 85 | | controller. It, among other things, registers the autoload handler, exception |
|---|
| 86 | | handler and assertion handler and loads subsystems. If $subsystems is not |
|---|
| 87 | | provided, the array is loaded from |
|---|
| 88 | | <filename>api/Jaws/Subsystem/CnfArray.php</filename>. |
|---|
| 89 | | </para> |
|---|
| 90 | | </sect2> |
|---|
| 91 | | |
|---|
| 92 | | <sect2> |
|---|
| 93 | | |
|---|
| 94 | | <title><function>Jaws::getRunMode</function></title> |
|---|
| 95 | | |
|---|
| 96 | | <methodsynopsis> |
|---|
| 97 | | <type>integer</type><methodname>Jaws::getRunMode</methodname> |
|---|
| 98 | | <void /> |
|---|
| 99 | | </methodsynopsis> |
|---|
| 100 | | |
|---|
| 101 | | <para> |
|---|
| 102 | | This method will return one of the <constant>Jaws::MODE_*</constant> constants |
|---|
| 103 | | (an <type>integer</type>) accordingly with the mode in which Jaws is running. |
|---|
| 104 | | </para> |
|---|
| 105 | | </sect2> |
|---|
| 106 | | </sect1> |
|---|
| 107 | | |
|---|
| 108 | | <sect1> |
|---|
| 109 | | <title>Subsystem interface</title> |
|---|
| 110 | | <para>The Jaws core object has three methods to manage subsystems.</para> |
|---|
| 111 | | |
|---|
| 112 | | <sect2> |
|---|
| 113 | | <title><function>Jaws::loadSs</function></title> |
|---|
| 114 | | |
|---|
| 115 | | <methodsynopsis> |
|---|
| 116 | | <type>void</type><methodname>Jaws::loadSs</methodname> |
|---|
| 117 | | <methodparam><type>string</type><parameter>subsystem</parameter></methodparam> |
|---|
| 118 | | </methodsynopsis> |
|---|
| 119 | | |
|---|
| 120 | | <para> |
|---|
| 121 | | This method is used to load a subsystem. The name of the subsystem should be |
|---|
| 122 | | specified. The Jaws object must have a property named |
|---|
| 123 | | <varname>$$subsystem</varname> so the subsystem can be created and accessed. |
|---|
| 124 | | </para> |
|---|
| 125 | | </sect2> |
|---|
| 126 | | |
|---|
| 127 | | <sect2> |
|---|
| 128 | | <title><function>Jaws::isSsLoaded</function></title> |
|---|
| 129 | | |
|---|
| 130 | | <methodsynopsis> |
|---|
| 131 | | <type>bool</type><methodname>Jaws::isSsLoaded</methodname> |
|---|
| 132 | | <methodparam><type>string</type><parameter>subsystem</parameter></methodparam> |
|---|
| 133 | | </methodsynopsis> |
|---|
| 134 | | |
|---|
| 135 | | <para> |
|---|
| 136 | | This method will return true if the subsystem is loaded, false otherwise. |
|---|
| 137 | | </para> |
|---|
| 138 | | </sect2> |
|---|
| 139 | | |
|---|
| 140 | | <sect2> |
|---|
| 141 | | <title><function>Jaws::getLoadedSs</function></title> |
|---|
| 142 | | |
|---|
| 143 | | <methodsynopsis> |
|---|
| 144 | | <type>array</type><methodname>Jaws::getLoadedSs</methodname> |
|---|
| 145 | | <void /> |
|---|
| 146 | | </methodsynopsis> |
|---|
| 147 | | |
|---|
| 148 | | <para> |
|---|
| 149 | | This method will return an array containing the list of loaded subsystems. |
|---|
| 150 | | </para> |
|---|
| 151 | | </sect2> |
|---|
| 152 | | </sect1> |
|---|
| | 13 | &internals.jawsobj.sections.runtimemode; |
|---|
| | 14 | &internals.jawsobj.sections.methods; |
|---|
| | 15 | &internals.jawsobj.sections.subsysteminterface; |
|---|