initPlugin example


    public function load($name$throwException = true)
    {
        if ($this->plugins->offsetExists($name)) {
            return $this;
        }
        foreach ($this->prefixPaths as $path => $prefix) {
            $file = $path . $name . DIRECTORY_SEPARATOR . 'Bootstrap.php';
            if (!file_exists($file)) {
                continue;
            }
            $this->initPlugin($name$prefix$file);

            return $this;
        }
        if ($throwException) {
            throw new Enlight_Exception('Plugin "' . $name . '" in namespace "' . $this->getName() . '" not found');
        }
    }

    /** * Loads all plugins in the plugin namespace. Iterate the prefix paths and looking for bootstrap files. */
    
continue;
                    }

                    $name = $dir->getFilename();

                    if ($this->validateIonCube($file)) {
                        throw new Exception(sprintf('Plugin "%s" is encrypted but the ionCube Loader extension is not installed', $name));
                    }

                    $plugin = $collection->get($name);
                    if ($plugin === null) {
                        $plugin = $collection->initPlugin($namenew Enlight_Config([
                            'source' => $source,
                            'path' => $dir->getPathname() . DIRECTORY_SEPARATOR,
                        ]));
                    }

                    $collection->registerPlugin($plugin$refreshDate);
                }
            }
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.