Skip to content

Commit

Permalink
[-] CORE : Fix #PSCSX-4910 trim empty line
Browse files Browse the repository at this point in the history
[-] CORE : Fix #PSCSX-4910 trim empty line
  • Loading branch information
Sacha Froment committed Mar 18, 2015
1 parent c61fb38 commit adf1b58
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 678 deletions.
4 changes: 3 additions & 1 deletion classes/module/Module.php
Expand Up @@ -2576,11 +2576,12 @@ public function addOverride($classname)

// Make a reflection of the override class and the module override class
$override_file = file($override_path);

$override_file = array_diff($override_file, array("\n"));
eval(preg_replace(array('#^\s*<\?(?:php)?#', '#class\s+'.$classname.'\s+extends\s+([a-z0-9_]+)(\s+implements\s+([a-z0-9_]+))?#i'), array(' ', 'class '.$classname.'OverrideOriginal'.$uniq), implode('', $override_file)));
$override_class = new ReflectionClass($classname.'OverrideOriginal'.$uniq);

$module_file = file($path_override);
$module_file = array_diff($module_file, array("\n"));
eval(preg_replace(array('#^\s*<\?(?:php)?#', '#class\s+'.$classname.'(\s+extends\s+([a-z0-9_]+)(\s+implements\s+([a-z0-9_]+))?)?#i'), array(' ', 'class '.$classname.'Override'.$uniq), implode('', $module_file)));
$module_class = new ReflectionClass($classname.'Override'.$uniq);

Expand Down Expand Up @@ -2631,6 +2632,7 @@ public function addOverride($classname)
if (!is_writable($dir_name))
throw new Exception(sprintf(Tools::displayError('directory (%s) not writable'), $dir_name));
$module_file = file($override_src);
$module_file = array_diff($module_file, array("\n"));

if ($orig_path)
{
Expand Down

0 comments on commit adf1b58

Please sign in to comment.