Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for Handler classes names without the directory name included #361

Open
mambax7 opened this issue Jun 22, 2015 · 0 comments
Open

Allow for Handler classes names without the directory name included #361

mambax7 opened this issue Jun 22, 2015 · 0 comments

Comments

@mambax7
Copy link
Contributor

mambax7 commented Jun 22, 2015

Currently, when we call getModuleHandler, it checks for the Handler class name that it uses the directory name:

$class = ucfirst(strtolower($module_dir)) . ucfirst($name) . 'Handler';
if (class_exists($class)) {
    $this->moduleHandlers[$module_dir][$name] = new $class($this->db());
}

Since we use Namespaces now, maybe we could change it to allow for only the class name + Handler:

$class = ucfirst(strtolower($module_dir)) . ucfirst($name) . 'Handler';
$classNew = ucfirst($name) . 'Handler';
if (class_exists($class)) {
    $this->moduleHandlers[$module_dir][$name] = new $class($this->db());
} elseif (class_exists($classNew)) {
    $this->moduleHandlers[$module_dir][$name] = new $classNew($this->db());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant