admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 1 | <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
| 2 | /** |
| 3 | * Code Igniter |
| 4 | * |
| 5 | * An open source application development framework for PHP 4.3.2 or newer |
| 6 | * |
| 7 | * @package CodeIgniter |
| 8 | * @author Rick Ellis |
| 9 | * @copyright Copyright (c) 2006, pMachine, Inc. |
| 10 | * @license http://www.codeignitor.com/user_guide/license.html |
| 11 | * @link http://www.codeigniter.com |
| 12 | * @since Version 1.0 |
| 13 | * @filesource |
| 14 | */ |
| 15 | |
| 16 | // ------------------------------------------------------------------------ |
| 17 | |
| 18 | /** |
| 19 | * Loader Class |
| 20 | * |
| 21 | * Loads views and files |
| 22 | * |
| 23 | * @package CodeIgniter |
| 24 | * @subpackage Libraries |
| 25 | * @author Rick Ellis |
| 26 | * @category Loader |
| 27 | * @link http://www.codeigniter.com/user_guide/libraries/loader.html |
| 28 | */ |
| 29 | class CI_Loader { |
| 30 | |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 31 | var $_ci_ob_level; |
| 32 | var $_ci_view_path = ''; |
| 33 | var $_ci_cached_vars = array(); |
| 34 | var $_ci_models = array(); |
| 35 | var $_ci_helpers = array(); |
| 36 | var $_ci_plugins = array(); |
| 37 | var $_ci_scripts = array(); |
| 38 | var $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); |
| 39 | |
| 40 | var $_ci_use_instance = FALSE; // This variable determines whether we should |
| 41 | // use $this or $CI =& get_instance() |
| 42 | // throughout this class. Don't mess with it. |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * Constructor |
| 46 | * |
| 47 | * Sets the path to the view files and gets the initial output |
| 48 | * buffering level |
| 49 | * |
| 50 | * @access public |
| 51 | */ |
| 52 | function CI_Loader() |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 53 | { |
| 54 | $this->_ci_view_path = APPPATH.'views/'; |
| 55 | $this->_ci_ob_level = ob_get_level(); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 56 | |
| 57 | log_message('debug', "Loader Class Initialized"); |
| 58 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 59 | |
| 60 | // -------------------------------------------------------------------- |
| 61 | |
| 62 | /** |
| 63 | * Class Loader |
| 64 | * |
| 65 | * This function lets users load and instantiate classes. |
| 66 | * It is designed to be called from a user's app controllers. |
| 67 | * |
| 68 | * @access public |
| 69 | * @param string the name of the class |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 70 | * @param sring the optional class variable name to assign the library to |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 71 | * @return void |
| 72 | */ |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 73 | function library($class, $varname = NULL) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 74 | { |
| 75 | if ($class == '') |
| 76 | return; |
| 77 | |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 78 | $this->_ci_load_class($class, $varname); |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 79 | $this->_ci_assign_to_models(); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 80 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 81 | |
| 82 | // -------------------------------------------------------------------- |
| 83 | |
| 84 | /** |
| 85 | * Model Loader |
| 86 | * |
| 87 | * This function lets users load and instantiate models. |
| 88 | * |
| 89 | * @access public |
| 90 | * @param string the name of the class |
| 91 | * @param mixed any initialization parameters |
| 92 | * @return void |
| 93 | */ |
| 94 | function model($model, $name = '', $db_conn = FALSE) |
| 95 | { |
| 96 | if ($model == '') |
| 97 | return; |
| 98 | |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 99 | // Is the model in a sub-folder? If so, parse out the filename and path. |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 100 | if (strpos($model, '/') === FALSE) |
| 101 | { |
| 102 | $path = ''; |
| 103 | } |
| 104 | else |
| 105 | { |
| 106 | $x = explode('/', $model); |
| 107 | $model = end($x); |
| 108 | unset($x[count($x)-1]); |
| 109 | $path = implode('/', $x).'/'; |
| 110 | } |
| 111 | |
| 112 | if ($name == '') |
| 113 | { |
| 114 | $name = $model; |
| 115 | } |
| 116 | |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 117 | if (in_array($name, $this->_ci_models, TRUE)) |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 118 | { |
| 119 | return; |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 120 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 121 | |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 122 | if ($this->_ci_use_instance) |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 123 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 124 | $CI =& get_instance(); |
| 125 | if (isset($CI->$name)) |
| 126 | { |
| 127 | show_error('The model name you are loading is the name of a resource that is already being used: '.$name); |
| 128 | } |
| 129 | } |
| 130 | else |
| 131 | { |
| 132 | if (isset($this->$name)) |
| 133 | { |
| 134 | show_error('The model name you are loading is the name of a resource that is already being used: '.$name); |
| 135 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | $model = strtolower($model); |
| 139 | |
| 140 | if ( ! file_exists(APPPATH.'models/'.$path.$model.EXT)) |
| 141 | { |
| 142 | show_error('Unable to locate the model you have specified: '.$model); |
| 143 | } |
| 144 | |
| 145 | if ($db_conn !== FALSE) |
| 146 | { |
| 147 | if ($db_conn === TRUE) |
| 148 | $db_conn = ''; |
| 149 | |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 150 | if ($this->_ci_use_instance) |
| 151 | { |
| 152 | $CI->load->database($db_conn, FALSE, TRUE); |
| 153 | } |
| 154 | else |
| 155 | { |
| 156 | $this->database($db_conn, FALSE, TRUE); |
| 157 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | if ( ! class_exists('Model')) |
| 161 | { |
| 162 | require_once(BASEPATH.'libraries/Model'.EXT); |
| 163 | } |
| 164 | |
| 165 | require_once(APPPATH.'models/'.$path.$model.EXT); |
| 166 | |
| 167 | $model = ucfirst($model); |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 168 | |
| 169 | if ($this->_ci_use_instance) |
| 170 | { |
| 171 | $CI->$name = new $model(); |
| 172 | } |
| 173 | else |
| 174 | { |
| 175 | $this->$name = new $model(); |
| 176 | } |
| 177 | |
| 178 | $this->_ci_models[] = $name; |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 179 | $this->_ci_assign_to_models(); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 180 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 181 | |
| 182 | // -------------------------------------------------------------------- |
| 183 | |
| 184 | /** |
| 185 | * Database Loader |
| 186 | * |
| 187 | * @access public |
| 188 | * @param string the DB credentials |
| 189 | * @param bool whether to return the DB object |
| 190 | * @param bool whether to enable active record (this allows us to override the config setting) |
admin | a5e812c | 2006-09-25 02:17:30 +0000 | [diff] [blame] | 191 | * @return object |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 192 | */ |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 193 | function database($params = '', $return = FALSE, $active_record = FALSE) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 194 | { |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 195 | require_once(BASEPATH.'database/DB'.EXT); |
admin | fd2750b | 2006-10-06 17:29:12 +0000 | [diff] [blame] | 196 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 197 | if ($return === TRUE) |
| 198 | { |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 199 | return DB($params, $return, $active_record); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 200 | } |
| 201 | else |
| 202 | { |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 203 | DB($params, $return, $active_record); |
| 204 | $this->_ci_assign_to_models(); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 205 | } |
| 206 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 207 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 208 | // -------------------------------------------------------------------- |
| 209 | |
| 210 | /** |
| 211 | * Load View |
| 212 | * |
| 213 | * This function is used to load a "view" file. It has three parameters: |
| 214 | * |
| 215 | * 1. The name of the "view" file to be included. |
| 216 | * 2. An associative array of data to be extracted for use in the view. |
| 217 | * 3. TRUE/FALSE - whether to return the data or load it. In |
| 218 | * some cases it's advantageous to be able to retun data so that |
| 219 | * a developer can process it in some way. |
| 220 | * |
| 221 | * @access public |
| 222 | * @param string |
| 223 | * @param array |
| 224 | * @param bool |
| 225 | * @return void |
| 226 | */ |
| 227 | function view($view, $vars = array(), $return = FALSE) |
| 228 | { |
| 229 | return $this->_ci_load(array('view' => $view, 'vars' => $this->_ci_object_to_array($vars), 'return' => $return)); |
| 230 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 231 | |
| 232 | // -------------------------------------------------------------------- |
| 233 | |
| 234 | /** |
| 235 | * Load File |
| 236 | * |
| 237 | * This is a generic file loader |
| 238 | * |
| 239 | * @access public |
| 240 | * @param string |
| 241 | * @param bool |
| 242 | * @return string |
| 243 | */ |
| 244 | function file($path, $return = FALSE) |
| 245 | { |
| 246 | return $this->_ci_load(array('path' => $path, 'return' => $return)); |
| 247 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 248 | |
| 249 | // -------------------------------------------------------------------- |
| 250 | |
| 251 | /** |
| 252 | * Set Variables |
| 253 | * |
| 254 | * Once variables are set they become availabe within |
| 255 | * the controller class and its "view" files. |
| 256 | * |
| 257 | * @access public |
| 258 | * @param array |
| 259 | * @return void |
| 260 | */ |
| 261 | function vars($vars = array()) |
| 262 | { |
| 263 | $vars = $this->_ci_object_to_array($vars); |
| 264 | |
| 265 | if (is_array($vars) AND count($vars) > 0) |
| 266 | { |
| 267 | foreach ($vars as $key => $val) |
| 268 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 269 | $this->_ci_cached_vars[$key] = $val; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 270 | } |
| 271 | } |
| 272 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 273 | |
| 274 | // -------------------------------------------------------------------- |
| 275 | |
| 276 | /** |
| 277 | * Load Helper |
| 278 | * |
| 279 | * This function loads the specified helper file. |
| 280 | * |
| 281 | * @access public |
| 282 | * @param mixed |
| 283 | * @return void |
| 284 | */ |
| 285 | function helper($helpers = array()) |
| 286 | { |
| 287 | if ( ! is_array($helpers)) |
| 288 | { |
| 289 | $helpers = array($helpers); |
| 290 | } |
| 291 | |
| 292 | foreach ($helpers as $helper) |
| 293 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 294 | if (isset($this->_ci_helpers[$helper])) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 295 | { |
| 296 | continue; |
| 297 | } |
| 298 | |
| 299 | $helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper'); |
| 300 | |
admin | 480da81 | 2006-09-20 21:11:04 +0000 | [diff] [blame] | 301 | if (file_exists(APPPATH.'helpers/'.$helper.EXT)) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 302 | { |
admin | 480da81 | 2006-09-20 21:11:04 +0000 | [diff] [blame] | 303 | include_once(APPPATH.'helpers/'.$helper.EXT); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 304 | } |
admin | 480da81 | 2006-09-20 21:11:04 +0000 | [diff] [blame] | 305 | else |
| 306 | { |
| 307 | if (file_exists(BASEPATH.'helpers/'.$helper.EXT)) |
| 308 | { |
| 309 | include_once(BASEPATH.'helpers/'.$helper.EXT); |
| 310 | } |
| 311 | else |
| 312 | { |
| 313 | show_error('Unable to load the requested file: helpers/'.$helper.EXT); |
| 314 | } |
| 315 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 316 | |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 317 | $this->_ci_helpers[$helper] = TRUE; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | log_message('debug', 'Helpers loaded: '.implode(', ', $helpers)); |
| 321 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 322 | |
| 323 | // -------------------------------------------------------------------- |
| 324 | |
| 325 | /** |
| 326 | * Load Helpers |
| 327 | * |
| 328 | * This is simply an alias to the above function in case the |
| 329 | * user has written the plural form of this function. |
| 330 | * |
| 331 | * @access public |
| 332 | * @param array |
| 333 | * @return void |
| 334 | */ |
| 335 | function helpers($helpers = array()) |
| 336 | { |
| 337 | $this->helper($helpers); |
| 338 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 339 | |
| 340 | // -------------------------------------------------------------------- |
| 341 | |
| 342 | /** |
| 343 | * Load Plugin |
| 344 | * |
| 345 | * This function loads the specified plugin. |
| 346 | * |
| 347 | * @access public |
| 348 | * @param array |
| 349 | * @return void |
| 350 | */ |
| 351 | function plugin($plugins = array()) |
| 352 | { |
| 353 | if ( ! is_array($plugins)) |
| 354 | { |
| 355 | $plugins = array($plugins); |
| 356 | } |
| 357 | |
| 358 | foreach ($plugins as $plugin) |
| 359 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 360 | if (isset($this->_ci_plugins[$plugin])) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 361 | { |
| 362 | continue; |
| 363 | } |
| 364 | |
admin | 480da81 | 2006-09-20 21:11:04 +0000 | [diff] [blame] | 365 | $plugin = strtolower(str_replace(EXT, '', str_replace('_plugin.', '', $plugin)).'_pi'); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 366 | |
admin | 480da81 | 2006-09-20 21:11:04 +0000 | [diff] [blame] | 367 | if (file_exists(APPPATH.'plugins/'.$plugin.EXT)) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 368 | { |
admin | 480da81 | 2006-09-20 21:11:04 +0000 | [diff] [blame] | 369 | include_once(APPPATH.'plugins/'.$plugin.EXT); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 370 | } |
admin | 480da81 | 2006-09-20 21:11:04 +0000 | [diff] [blame] | 371 | else |
| 372 | { |
| 373 | if (file_exists(BASEPATH.'plugins/'.$plugin.EXT)) |
| 374 | { |
| 375 | include_once(BASEPATH.'plugins/'.$plugin.EXT); |
| 376 | } |
| 377 | else |
| 378 | { |
| 379 | show_error('Unable to load the requested file: plugins/'.$plugin.EXT); |
| 380 | } |
| 381 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 382 | |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 383 | $this->_ci_plugins[$plugin] = TRUE; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 384 | } |
| 385 | |
| 386 | log_message('debug', 'Plugins loaded: '.implode(', ', $plugins)); |
| 387 | } |
admin | fd2750b | 2006-10-06 17:29:12 +0000 | [diff] [blame] | 388 | |
| 389 | // -------------------------------------------------------------------- |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 390 | |
admin | fd2750b | 2006-10-06 17:29:12 +0000 | [diff] [blame] | 391 | /** |
| 392 | * Load Plugins |
| 393 | * |
| 394 | * This is simply an alias to the above function in case the |
| 395 | * user has written the plural form of this function. |
| 396 | * |
| 397 | * @access public |
| 398 | * @param array |
| 399 | * @return void |
| 400 | */ |
| 401 | function plugins($plugins = array()) |
| 402 | { |
| 403 | $this->plugin($plugins); |
| 404 | } |
| 405 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 406 | // -------------------------------------------------------------------- |
| 407 | |
| 408 | /** |
| 409 | * Load Script |
| 410 | * |
| 411 | * This function loads the specified include file from the |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 412 | * application/scripts/ folder. |
| 413 | * |
| 414 | * NOTE: This feature has been deprecated but it will remain available |
| 415 | * for legacy users. |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 416 | * |
| 417 | * @access public |
| 418 | * @param array |
| 419 | * @return void |
| 420 | */ |
| 421 | function script($scripts = array()) |
| 422 | { |
| 423 | if ( ! is_array($scripts)) |
| 424 | { |
| 425 | $scripts = array($scripts); |
| 426 | } |
| 427 | |
| 428 | foreach ($scripts as $script) |
| 429 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 430 | if (isset($this->_ci_scripts[$script])) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 431 | { |
| 432 | continue; |
| 433 | } |
| 434 | |
| 435 | $script = strtolower(str_replace(EXT, '', $script)); |
| 436 | |
| 437 | if ( ! file_exists(APPPATH.'scripts/'.$script.EXT)) |
| 438 | { |
| 439 | show_error('Unable to load the requested script: scripts/'.$script.EXT); |
| 440 | } |
| 441 | |
| 442 | include_once(APPPATH.'scripts/'.$script.EXT); |
| 443 | |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 444 | $this->_ci_scripts[$script] = TRUE; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 445 | } |
| 446 | |
| 447 | log_message('debug', 'Scripts loaded: '.implode(', ', $scripts)); |
| 448 | } |
admin | fd2750b | 2006-10-06 17:29:12 +0000 | [diff] [blame] | 449 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 450 | // -------------------------------------------------------------------- |
| 451 | |
| 452 | /** |
| 453 | * Loads a language file |
| 454 | * |
| 455 | * @access public |
| 456 | * @param string |
| 457 | * @return void |
| 458 | */ |
| 459 | function language($file = '', $lang = '', $return = FALSE) |
| 460 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 461 | if ($this->_ci_use_instance) |
| 462 | { |
| 463 | $CI =& get_instance(); |
| 464 | return $CI->lang->load($file, $lang, $return); |
| 465 | } |
| 466 | else |
| 467 | { |
| 468 | return $this->lang->load($file, $lang, $return); |
| 469 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 470 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 471 | |
| 472 | // -------------------------------------------------------------------- |
| 473 | |
| 474 | /** |
| 475 | * Loads a config file |
| 476 | * |
| 477 | * @access public |
| 478 | * @param string |
| 479 | * @return void |
| 480 | */ |
| 481 | function config($file = '') |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 482 | { |
| 483 | if ($this->_ci_use_instance) |
| 484 | { |
| 485 | $CI =& get_instance(); |
| 486 | $CI->config->load($file); |
| 487 | } |
| 488 | else |
| 489 | { |
| 490 | $this->config->load($file); |
| 491 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 492 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 493 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 494 | // -------------------------------------------------------------------- |
| 495 | |
| 496 | /** |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 497 | * Scaffolding Loader |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 498 | * |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 499 | * This initializing function works a bit different than the |
| 500 | * others. It doesn't load the class. Instead, it simply |
| 501 | * sets a flag indicating that scaffolding is allowed to be |
| 502 | * used. The actual scaffolding function below is |
| 503 | * called by the front controller based on whether the |
| 504 | * second segment of the URL matches the "secret" scaffolding |
| 505 | * word stored in the application/config/routes.php |
| 506 | * |
| 507 | * @access public |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 508 | * @param string |
| 509 | * @return void |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 510 | */ |
| 511 | function scaffolding($table = '') |
| 512 | { |
| 513 | if ($table === FALSE) |
| 514 | { |
| 515 | show_error('You must include the name of the table you would like access when you initialize scaffolding'); |
| 516 | } |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 517 | |
| 518 | if ($this->_ci_use_instance) |
| 519 | { |
| 520 | $CI =& get_instance(); |
| 521 | $CI->_ci_scaffolding = TRUE; |
| 522 | $CI->_ci_scaff_table = $table; |
| 523 | } |
| 524 | else |
| 525 | { |
| 526 | $this->_ci_scaffolding = TRUE; |
| 527 | $this->_ci_scaff_table = $table; |
| 528 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 529 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 530 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 531 | // -------------------------------------------------------------------- |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 532 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 533 | /** |
| 534 | * Loader |
| 535 | * |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 536 | * This function is used to load views and files. |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 537 | * |
| 538 | * @access private |
| 539 | * @param array |
| 540 | * @return void |
| 541 | */ |
| 542 | function _ci_load($data) |
admin | 212a3fa | 2006-09-23 04:22:39 +0000 | [diff] [blame] | 543 | { |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 544 | // This allows anything loaded using $this->load (viwes, files, etc.) |
| 545 | // to become accessible from within the Controller and Model functions. |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 546 | // Only needed when running PHP 5 |
| 547 | |
| 548 | if ($this->_ci_use_instance) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 549 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 550 | $CI =& get_instance(); |
| 551 | foreach (get_object_vars($CI) as $key => $var) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 552 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 553 | if ( ! isset($this->$key)) |
| 554 | { |
| 555 | $this->$key =& $CI->$key; |
| 556 | } |
admin | e79dc71 | 2006-09-26 03:52:45 +0000 | [diff] [blame] | 557 | } |
| 558 | } |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 559 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 560 | // Set the default data variables |
| 561 | foreach (array('view', 'vars', 'path', 'return') as $val) |
| 562 | { |
| 563 | $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; |
| 564 | } |
| 565 | |
| 566 | /* |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 567 | * Extract and cache variables |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 568 | * |
admin | 212a3fa | 2006-09-23 04:22:39 +0000 | [diff] [blame] | 569 | * You can either set variables using the dedicated $this->load_vars() |
| 570 | * function or via the second parameter of this function. We'll merge |
| 571 | * the two types and cache them so that views that are embedded within |
| 572 | * other views can have access to these variables. |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 573 | */ |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 574 | if (is_array($vars)) |
| 575 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 576 | $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $vars); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 577 | } |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 578 | extract($this->_ci_cached_vars); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 579 | |
| 580 | // Set the path to the requested file |
| 581 | if ($path == '') |
| 582 | { |
| 583 | $ext = pathinfo($view, PATHINFO_EXTENSION); |
admin | 6ac4bea | 2006-09-02 17:46:15 +0000 | [diff] [blame] | 584 | $file = ($ext == '') ? $view.EXT : $view; |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 585 | $path = $this->_ci_view_path.$file; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 586 | } |
| 587 | else |
| 588 | { |
| 589 | $x = explode('/', $path); |
| 590 | $file = end($x); |
| 591 | } |
| 592 | |
| 593 | /* |
| 594 | * Buffer the output |
| 595 | * |
| 596 | * We buffer the output for two reasons: |
| 597 | * 1. Speed. You get a significant speed boost. |
| 598 | * 2. So that the final rendered template can be |
| 599 | * post-processed by the output class. Why do we |
| 600 | * need post processing? For one thing, in order to |
| 601 | * show the elapsed page load time. Unless we |
| 602 | * can intercept the content right before it's sent to |
admin | 212a3fa | 2006-09-23 04:22:39 +0000 | [diff] [blame] | 603 | * the browser and then stop the timer it won't be acurate. |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 604 | */ |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 605 | if ( ! file_exists($path)) |
| 606 | { |
| 607 | show_error('Unable to load the requested file: '.$file); |
| 608 | } |
| 609 | |
| 610 | ob_start(); |
| 611 | |
| 612 | include($path); |
| 613 | log_message('debug', 'File loaded: '.$path); |
| 614 | |
| 615 | // Return the file data if requested to |
| 616 | if ($return === TRUE) |
| 617 | { |
| 618 | $buffer = ob_get_contents(); |
| 619 | ob_end_clean(); |
| 620 | |
| 621 | return $buffer; |
| 622 | } |
| 623 | |
| 624 | /* |
| 625 | * Flush the buffer... or buff the flusher? |
| 626 | * |
admin | 212a3fa | 2006-09-23 04:22:39 +0000 | [diff] [blame] | 627 | * In order to permit views to be nested within |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 628 | * other views, we need to flush the content back out whenever |
| 629 | * we are beyond the first level of output buffering so that |
| 630 | * it can be seen and included properly by the first included |
| 631 | * template and any subsequent ones. Oy! |
| 632 | * |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 633 | */ |
| 634 | if (ob_get_level() > $this->_ci_ob_level + 1) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 635 | { |
| 636 | ob_end_flush(); |
| 637 | } |
| 638 | else |
| 639 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 640 | global $OUT; |
| 641 | $OUT->set_output(ob_get_contents()); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 642 | ob_end_clean(); |
| 643 | } |
| 644 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 645 | |
| 646 | // -------------------------------------------------------------------- |
| 647 | |
| 648 | /** |
| 649 | * Load class |
| 650 | * |
| 651 | * This function loads the requested class. |
| 652 | * |
| 653 | * @access private |
| 654 | * @param string the item that is being loaded |
| 655 | * @param mixed any additional parameters |
| 656 | * @return void |
| 657 | */ |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 658 | function _ci_load_class($class, $varname = NULL) |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 659 | { |
| 660 | // Prep the class name |
| 661 | $class = strtolower(str_replace(EXT, '', $class)); |
| 662 | |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 663 | // Is this a class extension request? |
| 664 | if (substr($class, 0, 3) == 'my_') |
| 665 | { |
| 666 | $class = preg_replace("/my_(.+)/", "\\1", $class); |
admin | 10c3f41 | 2006-10-08 07:21:12 +0000 | [diff] [blame] | 667 | |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 668 | // Load the requested library from the main system/libraries folder |
| 669 | if (file_exists(BASEPATH.'libraries/'.ucfirst($class).EXT)) |
| 670 | { |
| 671 | include_once(BASEPATH.'libraries/'.ucfirst($class).EXT); |
| 672 | } |
| 673 | |
| 674 | // Now look for a matching library |
| 675 | foreach (array(ucfirst($class), $class) as $filename) |
| 676 | { |
| 677 | if (file_exists(APPPATH.'libraries/'.$filename.EXT)) |
| 678 | { |
| 679 | include_once(APPPATH.'libraries/'.$filename.EXT); |
| 680 | } |
| 681 | } |
| 682 | |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 683 | return $this->_ci_init_class($filename, 'MY_', $varname); |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 684 | } |
admin | 10c3f41 | 2006-10-08 07:21:12 +0000 | [diff] [blame] | 685 | |
| 686 | // Lets search for the requested library file and load it. |
| 687 | // For backward compatibility we'll test for filenames that are |
| 688 | // both uppercase and lower. |
| 689 | foreach (array(ucfirst($class), $class) as $filename) |
| 690 | { |
| 691 | for ($i = 1; $i < 3; $i++) |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 692 | { |
admin | 10c3f41 | 2006-10-08 07:21:12 +0000 | [diff] [blame] | 693 | $path = ($i % 2) ? APPPATH : BASEPATH; |
| 694 | |
| 695 | if (file_exists($path.'libraries/'.$filename.EXT)) |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 696 | { |
admin | 10c3f41 | 2006-10-08 07:21:12 +0000 | [diff] [blame] | 697 | include_once($path.'libraries/'.$filename.EXT); |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 698 | return $this->_ci_init_class($filename, '', $varname); |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 699 | } |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | // If we got this far we were unable to find the requested class |
| 704 | log_message('error', "Unable to load the requested class: ".$class); |
| 705 | show_error("Unable to load the class: ".$class); |
| 706 | } |
| 707 | |
| 708 | // -------------------------------------------------------------------- |
| 709 | |
| 710 | /** |
| 711 | * Instantiates a class |
| 712 | * |
| 713 | * @access private |
| 714 | * @param string |
| 715 | * @param string |
| 716 | * @return null |
| 717 | */ |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 718 | function _ci_init_class($class, $prefix = '', $varname = NULL) |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 719 | { |
| 720 | // Is there an associated config file for this class? |
admin | b1fddc0 | 2006-10-09 21:29:07 +0000 | [diff] [blame] | 721 | $config = NULL; |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 722 | if (file_exists(APPPATH.'config/'.$class.EXT)) |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 723 | { |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 724 | include_once(APPPATH.'config/'.$class.EXT); |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 725 | } |
| 726 | |
| 727 | if ($prefix == '') |
| 728 | { |
admin | 10c3f41 | 2006-10-08 07:21:12 +0000 | [diff] [blame] | 729 | $name = (class_exists('CI_'.$class)) ? 'CI_'.$class : $class; |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 730 | } |
| 731 | else |
| 732 | { |
| 733 | $name = $prefix.$class; |
| 734 | } |
admin | 2f0bac8 | 2006-10-09 17:36:45 +0000 | [diff] [blame] | 735 | |
admin | b1fddc0 | 2006-10-09 21:29:07 +0000 | [diff] [blame] | 736 | // Set the variable name we will assign the class to |
| 737 | if ( ! is_null($varname)) |
| 738 | { |
| 739 | $classvar = $varname; |
| 740 | } |
| 741 | else |
| 742 | { |
| 743 | $class = strtolower($class); |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 744 | $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; |
admin | b1fddc0 | 2006-10-09 21:29:07 +0000 | [diff] [blame] | 745 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 746 | |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 747 | // Instantiate the class |
| 748 | if ($this->_ci_use_instance) |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 749 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 750 | $CI =& get_instance(); |
| 751 | if ($config !== NULL) |
| 752 | { |
| 753 | $CI->$classvar = new $name($config); |
| 754 | } |
| 755 | else |
| 756 | { |
| 757 | $CI->$classvar = new $name; |
| 758 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 759 | } |
| 760 | else |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 761 | { |
| 762 | if ($config !== NULL) |
| 763 | { |
| 764 | $this->$classvar = new $name($config); |
| 765 | } |
| 766 | else |
| 767 | { |
| 768 | $this->$classvar = new $name; |
| 769 | } |
| 770 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 771 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 772 | |
| 773 | // -------------------------------------------------------------------- |
| 774 | |
| 775 | /** |
| 776 | * Autoloader |
| 777 | * |
| 778 | * The config/autoload.php file contains an array that permits sub-systems, |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 779 | * libraries, plugins, and helpers to be loaded automatically. |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 780 | * |
| 781 | * @access private |
| 782 | * @param array |
| 783 | * @return void |
| 784 | */ |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 785 | function _ci_autoloader() |
| 786 | { |
| 787 | include_once(APPPATH.'config/autoload'.EXT); |
| 788 | |
| 789 | if ( ! isset($autoload)) |
| 790 | { |
| 791 | return FALSE; |
| 792 | } |
| 793 | |
| 794 | // Load any custome config file |
| 795 | if (count($autoload['config']) > 0) |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 796 | { |
| 797 | if ($this->_ci_use_instance) |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 798 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 799 | $CI =& get_instance(); |
| 800 | foreach ($autoload['config'] as $key => $val) |
| 801 | { |
| 802 | $CI->config->load($val); |
| 803 | } |
| 804 | } |
| 805 | else |
| 806 | { |
| 807 | foreach ($autoload['config'] as $key => $val) |
| 808 | { |
| 809 | $this->config->load($val); |
| 810 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 811 | } |
| 812 | } |
| 813 | |
| 814 | // Load plugins, helpers, and scripts |
| 815 | foreach (array('helper', 'plugin', 'script') as $type) |
| 816 | { |
| 817 | if (isset($autoload[$type]) AND count($autoload[$type]) > 0) |
| 818 | { |
| 819 | $this->$type($autoload[$type]); |
| 820 | } |
| 821 | } |
| 822 | |
| 823 | // A little tweak to remain backward compatible |
| 824 | // The $autoload['core'] item was deprecated |
| 825 | if ( ! isset($autoload['libraries'])) |
| 826 | { |
| 827 | $autoload['libraries'] = $autoload['core']; |
| 828 | } |
| 829 | |
| 830 | // Load libraries |
| 831 | if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0) |
| 832 | { |
admin | 10c3f41 | 2006-10-08 07:21:12 +0000 | [diff] [blame] | 833 | // Load the database driver. |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 834 | if (in_array('database', $autoload['libraries'])) |
| 835 | { |
| 836 | $this->database(); |
| 837 | $autoload['libraries'] = array_diff($autoload['libraries'], array('database')); |
| 838 | } |
| 839 | |
admin | 10c3f41 | 2006-10-08 07:21:12 +0000 | [diff] [blame] | 840 | // Load the model class. |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 841 | if (in_array('model', $autoload['libraries'])) |
| 842 | { |
| 843 | $this->model(); |
| 844 | $autoload['libraries'] = array_diff($autoload['libraries'], array('model')); |
| 845 | } |
admin | 10c3f41 | 2006-10-08 07:21:12 +0000 | [diff] [blame] | 846 | |
| 847 | // Load scaffolding |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 848 | if (in_array('scaffolding', $autoload['libraries'])) |
| 849 | { |
| 850 | $this->scaffolding(); |
| 851 | $autoload['libraries'] = array_diff($autoload['libraries'], array('scaffolding')); |
| 852 | } |
| 853 | |
admin | 10c3f41 | 2006-10-08 07:21:12 +0000 | [diff] [blame] | 854 | // Load all other libraries |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 855 | foreach ($autoload['libraries'] as $item) |
| 856 | { |
| 857 | $this->library($item); |
| 858 | } |
| 859 | } |
| 860 | } |
| 861 | |
| 862 | // -------------------------------------------------------------------- |
| 863 | |
| 864 | /** |
| 865 | * Assign to Models |
| 866 | * |
| 867 | * Makes sure that anything loaded by the loader class (libraries, plugins, etc.) |
| 868 | * will be available to modles, if any exist. |
| 869 | * |
| 870 | * @access public |
| 871 | * @param object |
| 872 | * @return array |
| 873 | */ |
| 874 | function _ci_assign_to_models() |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 875 | { |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 876 | if (count($this->_ci_models) == 0) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 877 | { |
| 878 | return; |
| 879 | } |
admin | cf49390 | 2006-10-10 07:12:31 +0000 | [diff] [blame^] | 880 | |
| 881 | if ($this->_ci_use_instance) |
| 882 | { |
| 883 | $CI =& get_instance(); |
| 884 | foreach ($this->_ci_models as $model) |
| 885 | { |
| 886 | $CI->$model->_assign_libraries(); |
| 887 | } |
| 888 | } |
| 889 | else |
| 890 | { |
| 891 | foreach ($this->_ci_models as $model) |
| 892 | { |
| 893 | $this->$model->_assign_libraries(); |
| 894 | } |
| 895 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 896 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 897 | |
| 898 | // -------------------------------------------------------------------- |
| 899 | |
| 900 | /** |
| 901 | * Object to Array |
| 902 | * |
| 903 | * Takes an object as input and convers the class variables to array key/vals |
| 904 | * |
| 905 | * @access public |
| 906 | * @param object |
| 907 | * @return array |
| 908 | */ |
| 909 | function _ci_object_to_array($object) |
| 910 | { |
admin | 2e5872a | 2006-09-06 02:32:55 +0000 | [diff] [blame] | 911 | return (is_object($object)) ? get_object_vars($object) : $object; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 912 | } |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 913 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 914 | |
| 915 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 916 | ?> |