Skip to content

Instantly share code, notes, and snippets.

@nautilebleu
Created September 6, 2011 14:54
Show Gist options
  • Save nautilebleu/1197771 to your computer and use it in GitHub Desktop.
Save nautilebleu/1197771 to your computer and use it in GitHub Desktop.
Loading modules in Prestashop 1.4
<?php
// http://svn.prestashop.com/trunk/classes/Module.php
$file = trim(file_get_contents(_PS_MODULE_DIR_.$module.'/'.$module.'.php'));
if (substr($file, 0, 5) == '<?php')
$file = substr($file, 5);
if (substr($file, -2) == '?>')
$file = substr($file, 0, -2);
if (class_exists($module, false) OR eval($file) !== false)
{
$moduleList[$moduleListCursor++] = new $module;
if (!$xml_exist OR $needNewConfigFile)
{
self::$_generateConfigXmlMode = true;
$tmpModule = new $module;
$tmpModule->_generateConfigXml();
self::$_generateConfigXmlMode = false;
}
}
@clemherreman
Copy link

AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHhhhhhhhh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment