src/CarteBlanche/App/Bundle.php
protected function init()
    {
        $_bundle_fname = $this->getNamespace().'Bundle';
        $_bundle_f = DirectoryHelper::slashDirname($this->getDirectory()).$_bundle_fname;
        if (@file_exists($_bundle_f.'.php')) {
            $cls_name = '\\'.$this->getNamespace().'\\'.$_bundle_fname;
            $this->instance = new $cls_name;
        } else {
            $_bundle_fname = $this->getNamespace().'Bundle';
            $_bundle_f = DirectoryHelper::slashDirname($this->getDirectory())
                . DirectoryHelper::slashDirname($this->getNamespace())
                . $_bundle_fname;
            if (@file_exists($_bundle_f.'.php')) {
                $cls_name = '\\'.$this->getNamespace().'\\'.$_bundle_fname;
                $this->instance = new $cls_name;
                if (method_exists($this->instance, 'setName')) {
//echo "> calling 'setName' on instance of ".get_class($this->instance).PHP_EOL;
                    call_user_func(array($this->instance, 'setName'), $this->getNamespace());
                }
                if (method_exists($this->instance, 'setPackageName')) {
//echo "> calling 'setPackageName' on instance of ".get_class($this->instance).PHP_EOL;
                    call_user_func(array($this->instance, 'setPackageName'), $this->getPackageName());
                }
                if (method_exists($this->instance, 'init')) {
//echo "> calling 'init' on instance of ".get_class($this->instance).PHP_EOL;
                    call_user_func(array($this->instance, 'init'), $this->getPackageData());
                }
            }
        }
    }
protected function init()
    {
        $_bundle_fname = $this->getNamespace().'Bundle';
        $_bundle_f = DirectoryHelper::slashDirname($this->getDirectory()).$_bundle_fname;
        if (@file_exists($_bundle_f.'.php')) {
            $cls_name = '\\'.$this->getNamespace().'\\'.$_bundle_fname;
            $this->instance = new $cls_name;
        } else {
            $_bundle_fname = $this->getNamespace().'Bundle';
            $_bundle_f = DirectoryHelper::slashDirname($this->getDirectory())
                . DirectoryHelper::slashDirname($this->getNamespace())
                . $_bundle_fname;
            if (@file_exists($_bundle_f.'.php')) {
                $cls_name = '\\'.$this->getNamespace().'\\'.$_bundle_fname;
                $this->instance = new $cls_name;
                if (method_exists($this->instance, 'setName')) {
//echo "> calling 'setName' on instance of ".get_class($this->instance).PHP_EOL;
                    call_user_func(array($this->instance, 'setName'), $this->getNamespace());
                }
                if (method_exists($this->instance, 'setPackageName')) {
//echo "> calling 'setPackageName' on instance of ".get_class($this->instance).PHP_EOL;
                    call_user_func(array($this->instance, 'setPackageName'), $this->getPackageName());
                }
                if (method_exists($this->instance, 'init')) {
//echo "> calling 'init' on instance of ".get_class($this->instance).PHP_EOL;
                    call_user_func(array($this->instance, 'init'), $this->getPackageData());
                }
            }
        }
    }
Initialize a bundle : register its namespace and load its global `[bundle name]Bundle` file