Posted by kanian on Tue 6 Nov 10:41
report abuse | View followups from Anonymous | download | new post
- <?php
- class ConfigPhp extends Zend_Config_Ini
- {
- private $defined_constants = null;
- private $php_defs = false;
- private $allow_mods = false;
- private $data = null;
- private $include_path='';
- public function __construct($filename, $section, $config = false)
- {
- {
- $this->php_defs = $config["php_defs"];
- $this->allow_mods = $config["allow_mods"];
- }
- Zend_Config_Ini::__construct($filename, $section, $this->allow_mods);
- if($this->php_defs)
- {
- $this->data = $this->toArray();
- $this->parsePHPDefs();
- }
- }
- protected function parsePHPDefs()
- {
- $report_error = null;
- {
- foreach($this->defined_constants["user"] as $key => $value)
- {
- foreach($this->data as $datakey => $dataval)
- {
- if($datakey == 'includes')
- {
- foreach($dataval as $inckey => $incval)
- {
- $pattern = '/(\.)?'.$key.'(\.)?/';
- $this->data["includes"][$inckey] = $incval;
- $this->__set($inckey,$incval);
- }
- }
- }
- }
- }
- }
- function makeIncludePath()
- {
- foreach($this->data as $datakey => $dataval)
- {
- if($datakey == 'includes')
- {
- foreach($dataval as $inckey => $incval)
- {
- $this->include_path.=$incval. DS.PATH_SEPARATOR;
- }
- }
- }
- $pattern ="/\'/";
- $replacement = "";
- }
- }
- ?>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.