/** * Constructor */ protected function __construct($reader, $module) { // store reader $this->_reader = $reader; // store module $this->_module = $module; // load module $this->_reader->load(strtolower($this->_module)); }
/** * Load a text packs */ public function load() { // get packs from arguments $packs = func_get_args(); for ($i = 0; $i < count($packs); $i++) { $pack = $packs[$i]; if (is_array($pack)) { // by mistake an array might be given. That's ok for ($j = 0; $j < count($pack); $j++) { $this->_reader->load($pack[$j]); } } else { $this->_reader->load($pack); } } return $this; }