<commit_before><?php

/*
*  Copyright (c) Codiad & <NAME> (co<EMAIL>), distributed
*  as-is and without warranty under the MIT License. See
*  [root]/license.txt for more. This information must remain intact.
*/

require_once('diff_match_patch.php');

class Filemanager {

    //////////////////////////////////////////////////////////////////
    // PROPERTIES
    //////////////////////////////////////////////////////////////////

    public $root          = "";
    public $project       = "";
    public $rel_path      = "";
    public $path          = "";
    public $type          = "";
    public $new_name      = "";
    public $content       = "";
    public $destination   = "";
    public $upload        = "";
    public $controller    = "";
    public $upload_json   = "";
    public $search_string = "";

    // JSEND Return Contents
    public $status        = "";
    public $data          = "";
    public $message       = "";

    //////////////////////////////////////////////////////////////////
    // METHODS
    //////////////////////////////////////////////////////////////////

    // -----------------------------||----------------------------- //

    //////////////////////////////////////////////////////////////////
    // Construct
    //////////////////////////////////////////////////////////////////

    public function __construct($get,$post,$files) {
        $this->rel_path = $get['path'];
        if($this->rel_path!="/"){ $this->rel_path .= "/"; }
        $this->root = $get['root'];
        $this->path = $this->root . $get['path'];
        // Search
        if(!empty($post['search_string'])){ $this->search_string = $post['search_string']; }
        // Create
        if(!empty($get['type'])){ $this->type = $get['type']; }
        // Modify\Create
        if(!empty($get['new_name'])){ $this->new_name = $get['new_name']; }

        foreach(['content', 'mtime', 'patch'] as $key){
            if(!empty($post[$key])){
                if(get_magic_quotes_gpc()){
                    $this->$key = stripslashes($post[$key]);
                }else{
                    $this->$key = $post[$key];
                }
            }
        }
        // Duplicate
        if(!empty($get['destination'])){ $this->destination = $this->root . $get['destination']; }
    }

    //////////////////////////////////////////////////////////////////
    // INDEX (Returns list of files and directories)
    //////////////////////////////////////////////////////////////////

    public function index(){

        if(file_exists($this->path)){
            $index = array();
            if(is_dir($this->path) && $handle = opendir($this->path)){<commit_msg>Remove usage of array shorthand notation<commit_after><?php

/*
*  Copyright (c) Codiad & <NAME> (co<EMAIL>), distributed
*  as-is and without warranty under the MIT License. See
*  [root]/license.txt for more. This information must remain intact.
*/

require_once('diff_match_patch.php');

class Filemanager {

    //////////////////////////////////////////////////////////////////
    // PROPERTIES
    //////////////////////////////////////////////////////////////////

    public $root          = "";
    public $project       = "";
    public $rel_path      = "";
    public $path          = "";
    public $type          = "";
    public $new_name      = "";
    public $content       = "";
    public $destination   = "";
    public $upload        = "";
    public $controller    = "";
    public $upload_json   = "";
    public $search_string = "";

    // JSEND Return Contents
    public $status        = "";
    public $data          = "";
    public $message       = "";

    //////////////////////////////////////////////////////////////////
    // METHODS
    //////////////////////////////////////////////////////////////////

    // -----------------------------||----------------------------- //

    //////////////////////////////////////////////////////////////////
    // Construct
    //////////////////////////////////////////////////////////////////

    public function __construct($get,$post,$files) {
        $this->rel_path = $get['path'];
        if($this->rel_path!="/"){ $this->rel_path .= "/"; }
        $this->root = $get['root'];
        $this->path = $this->root . $get['path'];
        // Search
        if(!empty($post['search_string'])){ $this->search_string = $post['search_string']; }
        // Create
        if(!empty($get['type'])){ $this->type = $get['type']; }
        // Modify\Create
        if(!empty($get['new_name'])){ $this->new_name = $get['new_name']; }

        foreach(array('content', 'mtime', 'patch') as $key){
            if(!empty($post[$key])){
                if(get_magic_quotes_gpc()){
                    $this->$key = stripslashes($post[$key]);
                }else{
                    $this->$key = $post[$key];
                }
            }
        }
        // Duplicate
        if(!empty($get['destination'])){ $this->destination = $this->root . $get['destination']; }
    }

    //////////////////////////////////////////////////////////////////
    // INDEX (Returns list of files and directories)
    //////////////////////////////////////////////////////////////////

    public function index(){

        if(file_exists($this->path)){
            $index = array();
            if(is_dir($this->path) && $handle = opendir($this->path)){
{'fraction_non_alphanumeric': 0.35952557449962935, 'fraction_numerical': 0.0, 'mean_word_length': 1.0289473684210526, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 39, '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': '6878423', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1256, 'n_words': 244}