Esempio n. 1
0
 public function executecode()
 {
     //$this->load->helper(array('form', 'email','cookie','googledrive'));
     $this->load->helper('generate');
     //$zip =  new ZipFile();
     $destination_path = $_GET['destination'];
     $zip_name_with_path = $_GET['zipName'];
     echo $action = $_GET['action'];
     $obj = new ZipFile();
     if (!isset($destination_path) || !isset($zip_name_with_path) || !isset($action)) {
         echo "If you want to extract any file then pass destination path in query string with (destination) parameter <br/>If you want to delete directory then pass destination path in query string with (destination) parameter <br/>If you want to make zip file then pass destination path & zip file path with name in query string with (destination & zipName) parameter";
     } else {
         switch ($action) {
             case 'Delete':
                 $obj->deleteDirectory($destination_path);
                 break;
             case 'Extract':
                 $obj->ExtractZip($destination_path);
                 break;
             case 'Zip':
                 $zipName = $zip_name_with_path;
                 $obj->MakeZip($destination_path, $zipName);
                 break;
             default:
                 echo "Please pass action";
         }
     }
 }