<commit_before><?php
require_once "myfuses/engine/MyFusesLoader.class.php";

/**
 * Abstract MyFuses loader.<br>
 * 
 *
 */
abstract class AbstractMyFusesLoader implements MyFusesLoader {
    
    /**
     * Loader application
     * 
     * @var Application
     */
    private $application;
    
    /**
     * Return the application
     *
     * @return Application
     */
    public function &getApplication(){
        return $this->application;
    }
    
    /**
     * Set the loader Application
     *
     * @param Application $application
     */
    public function setApplication( Application &$application ) {
        $this->application = $application;
    }
    
    /**
     * Load the application
     *
     */
    public function loadApplication() {
        // getting cache file
	    // TODO application load must be like fusebox official
        
        $allowRewite = $this->getApplication()->allowRewrite();
        
        if( is_file( $this->getApplication()->getCompleteCacheFile() ) 
            && ( $this->getApplication()->getMode() != "development" ) ) {
            require_once( $this->getApplication()->getCompleteCacheFile() );
            // correcting cached application reference
            $this->setApplication( 
                $this->getApplication()->getController()->getApplication( 
                    $this->application->getName() ) );
            
            if( $this->applicationWasModified() ) {
                $this->doLoadApplication();
            }
        }
        else {
            $this->doLoadApplication();
        }
        
        if( $this->getApplication()->allowRewrite() != $allowRewite ) {
            $this->getApplication()->setRewrite( $allowRewite );
        }
        
        // TODO put loadCircuit in this file
        foreach( $this->getApplication()->getCircits() as $circuit ) {
            if( $circuit->getName() != "MYFUSES_GLOBAL_CIRCUIT" ) {
                //TODO handle missing file error
	            $this->loadCircuit( $circuit );
            }
        }
        
        $this->getApplication()->setLoaded( true );
        
    }
    
    
    public function doLoadApplication() {<commit_msg>Fixing load process<commit_after><?php
require_once "myfuses/engine/MyFusesLoader.class.php";

/**
 * Abstract MyFuses loader.<br>
 * 
 *
 */
abstract class AbstractMyFusesLoader implements MyFusesLoader {
    
    /**
     * Loader application
     * 
     * @var Application
     */
    private $application;
    
    /**
     * Return the application
     *
     * @return Application
     */
    public function &getApplication(){
        return $this->application;
    }
    
    /**
     * Set the loader Application
     *
     * @param Application $application
     */
    public function setApplication( Application &$application ) {
        $this->application = $application;
    }
    
    /**
     * Load the application
     *
     */
    public function loadApplication() {
        // getting cache file
        $allowRewite = $this->getApplication()->allowRewrite();
        
        if( is_file( $this->getApplication()->getCompleteCacheFile() ) ) {
            require_once( $this->getApplication()->getCompleteCacheFile() );
            // correcting cached application reference
            $this->setApplication( 
                $this->getApplication()->getController()->getApplication( 
                    $this->application->getName() ) );
            if( $this->applicationWasModified() || 
                $this->getApplication()->getMode() == "development" ) {
                // TODO add Appliations constants
                $this->doLoadApplication();
            }
        }
        else {
            $this->doLoadApplication();
        }
        
        if( $this->getApplication()->allowRewrite() != $allowRewite ) {
            $this->getApplication()->setRewrite( $allowRewite );
        }
        
        // TODO put loadCircuit in this file
        foreach( $this->getApplication()->getCircits() as $circuit ) {
            if( $circuit->getName() != "MYFUSES_GLOBAL_CIRCUIT" ) {
                //TODO handle missing file error
	            $this->loadCircuit( $circuit );
            }
        }
        
        $this->getApplication()->setLoaded( true );
        
    }
    
    
    public function doLoadApplication() {
{'fraction_non_alphanumeric': 0.1258034894398531, 'fraction_numerical': 0.0, 'mean_word_length': 1.8182406209573092, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1352154', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1095, 'n_words': 216}