Microweber\Utils\Import::log PHP Method

log() public method

public log ( $save = null )
    public function log($save = null)
    {
        $chunks_folder = $this->get_import_location() . 'log' . DS;
        $index_file = $chunks_folder . 'log.json';
        if (!is_dir($chunks_folder)) {
            mkdir_recursive($chunks_folder);
        }
        if (!is_file($index_file)) {
            @touch($index_file);
        }
        if ($save !== null) {
            file_put_contents($index_file, json_encode($save));
            $save = null;
        }
        if ($save === null) {
            $cont = json_decode(file_get_contents($index_file), true);
            return $cont;
        }
        //return $chunks_folder;
    }