示例#1
0
 private function getIndexPath($file_type, $filename, $user_path, $folder_name)
 {
     // working in the user directory
     chdir($user_path);
     $index_path = NULL;
     switch ($file_type) {
         case 'text/html':
             // Create a dir with unique ID
             if (!file_exists($folder_name)) {
                 mkdir("./" . $folder_name);
             }
             // move index.html to the dir
             rename($filename['full_filename'], $folder_name . DS . $filename['full_filename']);
             $index_path = $folder_name . DS . $filename['full_filename'];
             chdir($filename['short_filename']);
             //$meta_data = $this->getMetaData($filename['full_filename']);
             //$slides = $this->parseHtmlFile($filename['full_filename']);
             break;
             // .zip archive
         // .zip archive
         case 'application/zip':
         case 'application/x-zip-compressed':
             if (ManipulationLib::unpackZipArchiveTo($filename['short_filename'], $filename['filename_ext'], $folder_name)) {
                 $index_path = $folder_name . DS . "index.html";
             }
             //$meta_data = $this->getMetaData("index" . "." . "html");
             //$slides = $this->parseHtmlFile("index" . "." . "html");
             break;
     }
     // going back to the root dir
     chdir("../../..");
     return $index_path;
 }