public static function loadClass($className = '', $p = null) { if (empty(self::$instancesClass[$className])) { \YcheukfReport\Lib\ALYS\ALYSFunction::debug($className, 'a', 'load class'); $o = self::getCoreClassNamePath($className, $p); if (!$o) { throw new \YcheukfReport\Lib\ALYS\ALYSException('ALYSEXT_CLASS_NOT_EXISTS' . "\n path=" . $className); } self::$instancesClass[$className] = $o; } // var_export(self::$instancesClass); return self::$instancesClass[$className]; }
/** * load engine */ private function _loadEngine($p) { $aInput = self::getInput(); $sEngDir = \YcheukfReport\Lib\ALYS\ALYSFunction::ucfirst($p); $sEngFile = \YcheukfReport\Lib\ALYS\ALYSFunction::ucfirst($aInput['input'][$p]['type']); //输入参数转化 $oInput = \YcheukfReport\Lib\ALYS\ALYSFunction::loadClass("report.input.{$sEngDir}.{$sEngFile}"); $oInput->fmtInput(); \YcheukfReport\Lib\ALYS\ALYSFunction::debug($aInput, 'a', "input data after fmt:report.engine.{$sEngDir}.{$sEngFile}"); //处理 $sObjectEng = $this->_enginName($sEngDir); $this->{$sObjectEng} = \YcheukfReport\Lib\ALYS\ALYSFunction::loadClass("report.engine.{$sEngDir}.{$sEngFile}"); self::$aOutput[$p] = $this->{$sObjectEng}->getData(); \YcheukfReport\Lib\ALYS\ALYSFunction::debug(self::$aOutput, 'a', "data after engine: report.engine.{$sEngDir}.{$sEngFile}"); //输出参数转化 $oOutput = \YcheukfReport\Lib\ALYS\ALYSFunction::loadClass("report.output.{$sEngDir}.{$sEngFile}"); $oOutput->fmtOutput(); \YcheukfReport\Lib\ALYS\ALYSFunction::debug(self::$aOutput, 'a', "data after output: report.engine.{$sEngDir}.{$sEngFile}"); }