ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

exact_config.php
Go to the documentation of this file.
1 <?php
2
3 /*
4 * This source code is a part of the Ultimix Project.
5 * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6 * it's own license wich could be found from the corresponding files or sources.
7 * This source code is provided "as is" without any warranties or garanties.
8 *
9 * Have a nice day!
10 *
11 * @url http://ultimix.sorceforge.net
12 *
13 * @author Alexey "gdever" Dodonov
14 */
15
26 class exact_config_1_0_0{
27
38 var $Trace = false;
39
54 function __construct()
55 {
56 try
57 {
58 $this->Trace = get_package( 'trace' , 'last' , __FILE__ );
59 }
60 catch( Exception $e )
61 {
62 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
63 }
64 }
65
88 function compile_exact_config( &$Options )
89 {
90 try
91 {
92 $PackageName = $Options->get_setting( 'package_name' , 0 );
93 $PackageVersion = $Options->get_setting( 'package_version' , 'last' );
94
95 $PackagePath = _get_package_relative_path_ex( $PackageName , $PackageVersion );
96 $ConfigFileName = $Options->get_setting( 'config' );
97
98 $ContextSet = get_package_object( 'gui::context_set' , 'last' , __FILE__ );
99 $ContextSet->add_context( dirname( $PackagePath )."/conf/$ConfigFileName" );
100
101 $Object = get_package( $PackageName , $PackageVersion , __FILE__ );
102 $ContextSet->execute( $Options , $Object , __FILE__ );
103
104 return( get_field( $Object , 'Output' , '' ) );
105 }
106 catch( Exception $e )
107 {
108 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
109 }
110 }
111
130 function controller( &$Options )
131 {
132 try
133 {
134 if( intval( $Options->get_setting( 'compile_exact_config' , 0 ) ) )
135 {
136 $this->compile_exact_config( $Options );
137 }
138 }
139 catch( Exception $e )
140 {
141 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
142 }
143 }
144
167 function view( &$Options )
168 {
169 try
170 {
171 if( intval( $Options->get_setting( 'compile_exact_config' , 0 ) ) )
172 {
173 return( $this->compile_exact_config( $Options ) );
174 }
175 }
176 catch( Exception $e )
177 {
178 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
179 }
180 }
181
200 function __toString()
201 {
202 try
203 {
204 return( serialize( $this->Config ) );
205 }
206 catch( Exception $e )
207 {
208 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
209 }
210 }
211 }
212
213 ?>