<commit_before><?php
/**
 * Used by unittests that have own dependencies in dependencies.ini
 */
class Kwf_Assets_Package_TestPackage extends Kwf_Assets_Package
{
    protected $_testDependenciesIni;
    protected $_rootComponentClass;

    public function __construct($testDependenciesIni, $dependencyName = 'TestFiles', $rootComponentClass = null)
    {
        $this->_testDependenciesIni = $testDependenciesIni;
        if (is_null($rootComponentClass)) {
            $rootComponentClass = Kwf_Component_Data_Root::getComponentClass();
        }
        $this->_rootComponentClass = $rootComponentClass;

        $testDependenciesIni = KWF_PATH.'/tests/'.str_replace('_', '/', $testDependenciesIni).'/dependencies.ini';
        $providers = array();
        $providers[] = new Kwf_Assets_Provider_Ini(KWF_PATH.'/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_Ini($testDependenciesIni);
        $providers[] = new Kwf_Assets_Provider_Ini(VENDOR_PATH.'/koala-framework/library-extjs2/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_Ini(VENDOR_PATH.'/koala-framework/library-jquery/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_Ini(VENDOR_PATH.'/koala-framework/library-swfobject/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_Ini(VENDOR_PATH.'/koala-framework/library-swfupload/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_IniNoFiles();
        $providers[] = new Kwf_Assets_Provider_Components($rootComponentClass);
        $providers[] = new Kwf_Assets_Provider_Dynamic();
        $providers[] = new Kwf_Assets_Provider_KwfUtils();
        $providers[] = new Kwf_Assets_Modernizr_Provider();
        $providers[] = new Kwf_Assets_Provider_DefaultAssets();
        $providers[] = new Kwf_Assets_Provider_ErrorHandler();
        $providers[] = new Kwf_Assets_Provider_JsClassKwf();
        $providerList = new Kwf_Assets_ProviderList_Abstract($providers);
        parent::__construct($providerList, $dependencyName);
    }

    public static function fromUrlParameter($class, $parameter)
    {
        $param = explode(':', $parameter);
        $testDependenciesIni = $param[0];
        $rootComponentClass = $param[1];
        if ($rootComponentClass) {
            Kwf_Component_Data_Root::setComponentClass($rootComponentClass);
        }
        return new $class($testDependenciesIni, $param[2]);
    }

    public function toUrlParameter()<commit_msg>Assets TestPackage: support dependencies.ini outside of KWF_PATH<commit_after><?php
/**
 * Used by unittests that have own dependencies in dependencies.ini
 */
class Kwf_Assets_Package_TestPackage extends Kwf_Assets_Package
{
    protected $_testDependenciesIni;
    protected $_rootComponentClass;

    public function __construct($testDependenciesIni, $dependencyName = 'TestFiles', $rootComponentClass = null)
    {
        $this->_testDependenciesIni = $testDependenciesIni;
        if (is_null($rootComponentClass)) {
            $rootComponentClass = Kwf_Component_Data_Root::getComponentClass();
        }
        $this->_rootComponentClass = $rootComponentClass;

        $testDependenciesIni = str_replace('_', '/', $testDependenciesIni).'/dependencies.ini';
        if (file_exists('tests/'.$testDependenciesIni)) {
            $testDependenciesIni = 'tests/'.$testDependenciesIni;
        } else if (file_exists(KWF_PATH.'/tests/'.$testDependenciesIni)) {
            $testDependenciesIni = KWF_PATH.'/tests/'.$testDependenciesIni;
        }
        $providers = array();
        $providers[] = new Kwf_Assets_Provider_Ini(KWF_PATH.'/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_Ini($testDependenciesIni);
        $providers[] = new Kwf_Assets_Provider_Ini(VENDOR_PATH.'/koala-framework/library-extjs2/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_Ini(VENDOR_PATH.'/koala-framework/library-jquery/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_Ini(VENDOR_PATH.'/koala-framework/library-swfobject/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_Ini(VENDOR_PATH.'/koala-framework/library-swfupload/dependencies.ini');
        $providers[] = new Kwf_Assets_Provider_IniNoFiles();
        $providers[] = new Kwf_Assets_Provider_Components($rootComponentClass);
        $providers[] = new Kwf_Assets_Provider_Dynamic();
        $providers[] = new Kwf_Assets_Provider_KwfUtils();
        $providers[] = new Kwf_Assets_Modernizr_Provider();
        $providers[] = new Kwf_Assets_Provider_DefaultAssets();
        $providers[] = new Kwf_Assets_Provider_ErrorHandler();
        $providers[] = new Kwf_Assets_Provider_JsClassKwf();
        $providerList = new Kwf_Assets_ProviderList_Abstract($providers);
        parent::__construct($providerList, $dependencyName);
    }

    public static function fromUrlParameter($class, $parameter)
    {
        $param = explode(':', $parameter);
        $testDependenciesIni = $param[0];
        $rootComponentClass = $param[1];
        if ($rootComponentClass) {
            Kwf_Component_Data_Root::setComponentClass($rootComponentClass);
        }
        return new $class($testDependenciesIni, $param[2]);
    }

    public function toUrlParameter()
{'fraction_non_alphanumeric': 0.11834319526627218, 'fraction_numerical': 0.0015270089711777056, 'mean_word_length': 4.06280193236715, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5266515', 'n_tokens_mistral': 1636, 'n_tokens_neox': 1563, 'n_words': 228}