public function loadPlugin($namespace, $path)
    {
        $className = $namespace.'\Plugin';
        $classPath = $path.'/Plugin.php';

        try {
            // Autoloader failed?
            if (!class_exists($className)) {
                include_once $classPath;
            }

            // Not a valid plugin!
            if (!class_exists($className)) {
                return;
            }

            $classObj = new $className($this->app);
        } catch (\Throwable $e) {
            Log::error('Plugin ' . $className . ' could not be instantiated.', [
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
                'trace' => $e->getTraceAsString()
            ]);
            return;
        }

        $classId = $this->getIdentifier($classObj);

        /*
         * Check for disabled plugins
         */
        if ($this->isDisabled($classId)) {
            $classObj->disabled = true;
        }

        $this->plugins[$classId] = $classObj;
        $this->pathMap[$classId] = $path;

        return $classObj;
    }
public function loadPlugin($namespace, $path)
    {
        $className = $namespace.'\Plugin';
        $classPath = $path.'/Plugin.php';

        try {
            // Autoloader failed?
            if (!class_exists($className)) {
                include_once $classPath;
            }

            // Not a valid plugin!
            if (!class_exists($className)) {
                return;
            }

            $classObj = new $className($this->app);
        } catch (\Throwable $e) {
            Log::error('Plugin ' . $className . ' could not be instantiated.', [
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
                'trace' => $e->getTraceAsString()
            ]);
            return;
        }

        $classId = $this->getIdentifier($classObj);

        /*
         * Check for disabled plugins
         */
        if ($this->isDisabled($classId)) {
            $classObj->disabled = true;
        }

        $this->plugins[$classId] = $classObj;
        $this->pathMap[$classId] = $path;

        return $classObj;
    }
public function loadPlugin ( $ namespace , $ path ) { $ className = $ namespace . '\Plugin' ; $ classPath = $ path . '/Plugin.php' ; try { // Autoloader failed? if ( ! class_exists ( $ className ) ) { include_once $ classPath ; } // Not a valid plugin! if ( ! class_exists ( $ className ) ) { return ; } $ classObj = new $ className ( $ this -> app ) ; } catch ( \ Throwable $ e ) { Log :: error ( 'Plugin ' . $ className . ' could not be instantiated.' , [ 'message' => $ e -> getMessage ( ) , 'file' => $ e -> getFile ( ) , 'line' => $ e -> getLine ( ) , 'trace' => $ e -> getTraceAsString ( ) ] ) ; return ; } $ classId = $ this -> getIdentifier ( $ classObj ) ; /*
         * Check for disabled plugins
         */ if ( $ this -> isDisabled ( $ classId ) ) { $ classObj -> disabled = true ; } $ this -> plugins [ $ classId ] = $ classObj ; $ this -> pathMap [ $ classId ] = $ path ; return $ classObj ; }
Loads a single plugin in to the manager.
@param string $namespace Eg: Acme\Blog
@param string $path Eg: plugins_path().'/acme/blog';
@return void
Loads a single plugin in to the manager .