/** * Constructor */ public function __construct(ICE_Component $component = null) { // get a component? if ($component) { $this->component = $component; } // init files imported stack if (!self::$files_imported instanceof ICE_Stack) { self::$files_imported = new ICE_Stack(); } }
/** * Constructor */ public function __construct(ICE_Component $component = null) { // get a component? if ($component) { $this->component = $component; } // init maps and stacks $this->sections = new ICE_Map(); $this->deps = new ICE_Stack(); $this->files = new ICE_Map(); $this->files_export = new ICE_Map(); $this->callbacks = new ICE_Map(); $this->strings = new ICE_Stack(); if (!self::$files_imported instanceof ICE_Stack) { self::$files_imported = new ICE_Stack(); } }
/** */ protected function get_file_contents($filename) { // run parent to get content $content = parent::get_file_contents($filename); // get content? if ($content) { // new file info instance $fi = new ICE_File($filename); // save last filename $this->last_dirname = $fi->getPath(); // handle any pre-processing switch ($fi->getExtension()) { // its a LESS CSS file case 'less': // load less parser ICE_Loader::load('parsers/less'); // parse it $content = ICE_Less::parse($content, $fi->getPath()); // done with less break; } // replace all CSS url() values return preg_replace_callback('/url\\s*\\([\'\\"\\s]*([^\'\\"\\s]*)[\'\\"\\s]*\\)/', array($this, 'fix_url_path'), $content); } }
/** * Generate javascript markup for this script's dynamic code * * @return string */ public function export() { // the markup that will be returned $code = parent::export(); // render rules if (count($this->logic_stack)) { // begin script generation $code .= sprintf('/*+++ begin script: %s */', $this->token) . PHP_EOL; // loop all logic objects foreach ($this->logic_stack as $logic) { // append output of logic export $code .= $logic->export(); } // end script generation $code .= sprintf('/*+++ end script: %s */', $this->token) . PHP_EOL . PHP_EOL; } // all done return $code; }