@@ -76,22 +76,26 @@ public function init(ModuleManager $moduleManager)
7676 * @param ModuleEvent $e
7777 * @return void
7878 */
79- public function loadConfiguration (ModuleEvent $ e )
79+ public function loadConfiguration (ModuleEvent $ event )
8080 {
81- define ("DOMPDF_LIB_DIR " , __DIR__ . '/../../../dompdf/lib/vendor ' );
81+ define ("DOMPDF_DIR " , __DIR__ . '/../../vendor/dompdf ' );
82+ define ("DOMPDF_INC_DIR " , DOMPDF_DIR . "/include " );
83+ define ("DOMPDF_LIB_DIR " , DOMPDF_DIR . "/lib " );
8284
83- $ mergedConfig = $ e ->getConfigListener ()->getMergedConfig ();
84- $ config = $ mergedConfig ['dompdf_module ' ];
85-
86- foreach ($ config as $ key => $ value ) {
85+ $ config = $ event ->getConfigListener ()->getMergedConfig ();
86+ foreach ($ config ['dompdf_module ' ] as $ key => $ value ) {
8787 if (! array_key_exists ($ key , self ::$ configCompatMapping )) {
8888 continue ;
8989 }
9090
9191 define (self ::$ configCompatMapping [$ key ], $ value );
9292 }
9393
94- require_once __DIR__ . "/../../../dompdf/lib/DOMPDF/functions.inc.php " ;
94+ define ("DOMPDF_AUTOLOAD_PREPEND " , false );
95+
96+ require_once DOMPDF_INC_DIR . '/functions.inc.php ' ;
97+ require_once DOMPDF_LIB_DIR . '/html5lib/Parser.php ' ;
98+ require_once DOMPDF_INC_DIR . '/autoload.inc.php ' ;
9599 require_once __DIR__ . '/../../config/module.compat.php ' ;
96100 }
97101
@@ -102,4 +106,15 @@ public function getConfig()
102106 {
103107 return include __DIR__ . '/../../config/module.config.php ' ;
104108 }
109+
110+ public function getAutoloaderConfig ()
111+ {
112+ return array (
113+ 'Zend\Loader\StandardAutoloader ' => array (
114+ 'namespaces ' => array (
115+ __NAMESPACE__ => __DIR__ ,
116+ ),
117+ ),
118+ );
119+ }
105120}
0 commit comments