<commit_before><?php
/**
 * phpDocumentor
 *
 * PHP Version 5
 *
 * @category  phpDocumentor
 * @package   Core
 * @author    <NAME> <<EMAIL>>
 * @copyright 2010-2011 <NAME> / Naenius (http://www.naenius.com)
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
 * @link      http://phpdoc.org
 */

/**
 * This class provides a bootstrap for all application who wish to interface
 * with phpDocumentor.
 *
 * The Boostrapper is responsible for setting up the phpDocumentor autoloader, setting
 * up the event dispatcher and initializing the plugins.
 *
 * @category phpDocumentor
 * @package  Core
 * @author   <NAME> <<EMAIL>>
 * @license  http://www.opensource.org/licenses/mit-license.php MIT
 * @link     http://phpdoc.org
 */
class phpDocumentor_Bootstrap
{
    /**
     * Helper static function to get an instance of this class.
     *
     * Usually used to do a one-line initialization, such as:
     *
     *     phpDocumentor_Bootstrap::createInstance()->initialize();
     *
     * @return phpDocumentor_Bootstrap
     */
    public static function createInstance()
    {
        return new self();
    }

    /**
     * Convenience method that does the complete initialization for phpDocumentor.
     *
     * This method will register the autoloader, event dispatcher and plugins.
     * The methods called can also be implemented separately, for example when
     * you want to use your own autoloader.
     *
     * @return void
     */
    public function initialize()
    {
        $autoloader = $this->registerAutoloader();
        $this->registerPlugins($autoloader);
    }

    /**
     * Registers and returns the autoloader for phpDocumentor.
     *
     * phpDocumentor uses the ZF2 autoloader to register the common paths and start
     * a PSR-0 fallback.
     *
     * The autoloader is also used by the plugin system to make sure that
     * everything in a plugin can be autoloaded.
     *
     * @return \Composer\Autoload\ClassLoader
     */
    public function registerAutoloader()
    {
        return include_once __DIR__ . '/../../vendor/.composer/autoload.php';
    }

    /**
     * Registers the Event Dispatcher and registers all plugins.
     *
     * @param ZendX_Loader_StandardAutoloader $autoloader the autoloader upon
     *  which will the plugins will bind their class prefixes and folders.
     *
     * @return void
     */
    public function registerPlugins($autoloader)
    {
        // initialize the event dispatcher; the include is here explicitly
        // should anyone not want this dependency and thus nto invoke this
        // method
        $dispatcher = new sfEventDispatcher();

        // initialize the plugin manager
        $plugin_manager = new phpDocumentor_Plugin_Manager(
            $dispatcher,
            phpDocumentor_Core_Abstract::config(),
            $autoloader
        );

        $plugin_manager->loadFromConfiguration();

        $this->attachDispatcher($dispatcher);
    }

    /**
     * attaches the event dispatcher to all components.
     *
     * @param sfEventDispatcher $event_dispatcher The event dispatcher to attach.
     *
     * @return void
     */
    protected function attachDispatcher($event_dispatcher)
    {
        phpDocumentor_Parser_Abstract::$event_dispatcher      = $event_dispatcher;
        phpDocumentor_Transformer_Abstract::$event_dispatcher = $event_dispatcher;
        phpDocumentor_Reflection_Abstract::$event_dispatcher  = $event_dispatcher;
    }
}<commit_msg>/vendor/.composer/autoload.php is deprecated use new composer autoload.php path<commit_after><?php
/**
 * phpDocumentor
 *
 * PHP Version 5
 *
 * @category  phpDocumentor
 * @package   Core
 * @author    <NAME> <<EMAIL>>
 * @copyright 2010-2011 <NAME> / Naenius (http://www.naenius.com)
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
 * @link      http://phpdoc.org
 */

/**
 * This class provides a bootstrap for all application who wish to interface
 * with phpDocumentor.
 *
 * The Boostrapper is responsible for setting up the phpDocumentor autoloader, setting
 * up the event dispatcher and initializing the plugins.
 *
 * @category phpDocumentor
 * @package  Core
 * @author   <NAME> <<EMAIL>>
 * @license  http://www.opensource.org/licenses/mit-license.php MIT
 * @link     http://phpdoc.org
 */
class phpDocumentor_Bootstrap
{
    /**
     * Helper static function to get an instance of this class.
     *
     * Usually used to do a one-line initialization, such as:
     *
     *     phpDocumentor_Bootstrap::createInstance()->initialize();
     *
     * @return phpDocumentor_Bootstrap
     */
    public static function createInstance()
    {
        return new self();
    }

    /**
     * Convenience method that does the complete initialization for phpDocumentor.
     *
     * This method will register the autoloader, event dispatcher and plugins.
     * The methods called can also be implemented separately, for example when
     * you want to use your own autoloader.
     *
     * @return void
     */
    public function initialize()
    {
        $autoloader = $this->registerAutoloader();
        $this->registerPlugins($autoloader);
    }

    /**
     * Registers and returns the autoloader for phpDocumentor.
     *
     * phpDocumentor uses the ZF2 autoloader to register the common paths and start
     * a PSR-0 fallback.
     *
     * The autoloader is also used by the plugin system to make sure that
     * everything in a plugin can be autoloaded.
     *
     * @return \Composer\Autoload\ClassLoader
     */
    public function registerAutoloader()
    {
        return include_once __DIR__ . '/../../vendor/autoload.php';
    }

    /**
     * Registers the Event Dispatcher and registers all plugins.
     *
     * @param ZendX_Loader_StandardAutoloader $autoloader the autoloader upon
     *  which will the plugins will bind their class prefixes and folders.
     *
     * @return void
     */
    public function registerPlugins($autoloader)
    {
        // initialize the event dispatcher; the include is here explicitly
        // should anyone not want this dependency and thus nto invoke this
        // method
        $dispatcher = new sfEventDispatcher();

        // initialize the plugin manager
        $plugin_manager = new phpDocumentor_Plugin_Manager(
            $dispatcher,
            phpDocumentor_Core_Abstract::config(),
            $autoloader
        );

        $plugin_manager->loadFromConfiguration();

        $this->attachDispatcher($dispatcher);
    }

    /**
     * attaches the event dispatcher to all components.
     *
     * @param sfEventDispatcher $event_dispatcher The event dispatcher to attach.
     *
     * @return void
     */
    protected function attachDispatcher($event_dispatcher)
    {
        phpDocumentor_Parser_Abstract::$event_dispatcher      = $event_dispatcher;
        phpDocumentor_Transformer_Abstract::$event_dispatcher = $event_dispatcher;
        phpDocumentor_Reflection_Abstract::$event_dispatcher  = $event_dispatcher;
    }
}
{'fraction_non_alphanumeric': 0.08879432624113476, 'fraction_numerical': 0.003120567375886525, 'mean_word_length': 2.6270576131687244, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6321815', 'n_tokens_mistral': 2021, 'n_tokens_neox': 1946, 'n_words': 579}