Permalink
Browse files

Fixing #166

  • Loading branch information...
1 parent 784bcf7 commit eeb278c196e44a28b6addc0d82f2033d5487b6e5 @zyxist zyxist committed Nov 1, 2010
Showing with 3 additions and 10 deletions.
  1. +3 −10 lib/Opt/Class.php
View
@@ -599,17 +599,10 @@ public function _getList($name)
protected function _pluginLoader($directory, SplFileInfo $file)
{
$ns = explode('.', $file->getFilename());
- if(end($ns) == 'php')
+ $filename = $file->getFilename();
+ if(strpos($filename, '.php') === (strlen($filename) - 4))
{
- switch($ns[0])
- {
- case 'instruction':
- return 'Opl_Loader::mapAbsolute(\'Opt_Instruction_'.$ns[1].'\', \''.$directory.$file->getFilename().'\'); $this->register(Opt_Class::OPT_INSTRUCTION, \''.$ns[1].'\'); ';
- case 'format':
- return 'Opl_Loader::mapAbsolute(\'Opt_Format_'.$ns[1].'\', \''.$directory.$file->getFilename().'\'); $this->register(Opt_Class::OPT_FORMAT, \''.$ns[1].'\'); ';
- default:
- return ' require(\''.$directory.$file->getFilename().'\'); ';
- }
+ return ' require(\''.$directory.$filename.'\'); ';
}
} // end _pluginLoader();

0 comments on commit eeb278c

Please sign in to comment.