src/Pupcake/Pupcake.php
public function usePlugin($plugin_name, $config = array())
    {
        if (!isset($this->plugins[$plugin_name])) {
            $plugin_name = str_replace(".", "\\", $plugin_name);
            //allow plugin name to use . sign
            $plugin_class_name = $plugin_name."\Main";
            $this->plugins[$plugin_name] = new $plugin_class_name();
            $this->plugins[$plugin_name]->setAppInstance($this);
            $this->plugins[$plugin_name]->load($config);
        }
        return $this->plugins[$plugin_name];
    }
public function usePlugin($plugin_name, $config = array())
    {
        if (!isset($this->plugins[$plugin_name])) {
            $plugin_name = str_replace(".", "\\", $plugin_name);
            //allow plugin name to use . sign
            $plugin_class_name = $plugin_name."\Main";
            $this->plugins[$plugin_name] = new $plugin_class_name();
            $this->plugins[$plugin_name]->setAppInstance($this);
            $this->plugins[$plugin_name]->load($config);
        }
        return $this->plugins[$plugin_name];
    }
public function usePlugin ( $ plugin_name , $ config = array ( ) ) { if ( ! isset ( $ this -> plugins [ $ plugin_name ] ) ) { $ plugin_name = str_replace ( "." , "\\" , $ plugin_name ) ; //allow plugin name to use . sign $ plugin_class_name = $ plugin_name . "\Main" ; $ this -> plugins [ $ plugin_name ] = new $ plugin_class_name ( ) ; $ this -> plugins [ $ plugin_name ] -> setAppInstance ( $ this ) ; $ this -> plugins [ $ plugin_name ] -> load ( $ config ) ; } return $ this -> plugins [ $ plugin_name ] ; }
tell the sytem to use a plugin
tell the sytem to use a plugin