Skip to content
Zimo Xiao edited this page Mar 8, 2018 · 9 revisions

file::upload

  • Name:

    upload - store a file
  • Synopsis:

    file::upload($_FILES['name'], $name)
  • Description:

    • upload a file with given name

    • file::upload($file['name'], $name);
      //name can be a path of just a name (auto-store under file folder)
    • return true if success, false otherwise

file::read

  • Name:

    read - read a file
  • Synopsis:

    file::read($local_path)
  • Description:

    • read a file from the specified local path

    • file::read($path);
      //read multiple files by passing $path as an array of paths
    • returns string

file::write

  • Name:

    write - write a file
  • Synopsis:

    file::write([$path => $value])
  • Description:

    • write in to files from the specified series of paths

    • file::write([
        $path_1 =>  $value_1,
        $path_2 =>  $value_2
        //your path-value pairs
      ]);

file::download

  • Name:

    download - download a file from specified path with the name
  • Synopsis:

    file::download($path, $name, $download_rate)
  • Description:

    • download_rate is optional and in kb/s, default value is 20 kb/s

    • file::download($path, $name, 30);
      //download a file from $path with the speed of 30 kb/s and rename it $name

file::delete

  • Name:

    delete - delete a file
  • Synopsis:

    file::delete($path)
  • Description:

    • delete a file from the specified path

    • file::delete($path);
      //delete multiple files by passing $path as an array of paths

file::zip

  • Name:

    zip - zip a series of files
  • Synopsis:

    file::zip($destination_path, $path_of_initial_files)
  • Description:

    • file::zip($local_path,[
          $path_of_file_1 => 'rename1.txt',
          $path_of_file_2 => 'rename2.txt',
          $path_of_file_3 => 'rename3.txt'
      ]);
      //$local_path is the path + zip_name
      //example: /your/dir/1.zip

file::unzip

  • Name:

    unzip - unzip a file
  • Synopsis:

    file::unzip($file, $path)
  • Description:

    • file::unzip($zip_path,$extract_to_path);

file::create

  • Name:

    create - create an empty file
  • Synopsis:

    file::create($dir_and_name);
  • Description:

    • file::create([user::dir().'/file/txt/1.txt'
                  ,user::dir().'/file/txt/2.txt']);
      //create two empty files
      
      file::create(user::dir().'/file/txt/1.txt');
      //create an empty files

Getting Started

Data Structure

Networking

Operations

Features

Clone this wiki locally