From 1ff5c35de5dbd70a782875a91dd2232fd01b002b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:38:04 +0200 Subject: Adding upstream version 0.10.1. Signed-off-by: Daniel Baumann --- .../stdlib/src/Loader/AutoloadingPluginLoader.php | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 vendor/ipl/stdlib/src/Loader/AutoloadingPluginLoader.php (limited to 'vendor/ipl/stdlib/src/Loader/AutoloadingPluginLoader.php') diff --git a/vendor/ipl/stdlib/src/Loader/AutoloadingPluginLoader.php b/vendor/ipl/stdlib/src/Loader/AutoloadingPluginLoader.php new file mode 100644 index 0000000..ba195c6 --- /dev/null +++ b/vendor/ipl/stdlib/src/Loader/AutoloadingPluginLoader.php @@ -0,0 +1,52 @@ +namespace = $namespace; + $this->postfix = $postfix; + } + + /** + * Get the FQN of a plugin + * + * @param string $name Name of the plugin + * + * @return string + */ + protected function getFqn($name) + { + return $this->namespace . '\\' . ucfirst($name) . $this->postfix; + } + + public function load($name) + { + $class = $this->getFqn($name); + + if (! class_exists($class)) { + return false; + } + + return $class; + } +} -- cgit v1.2.3