public function archive() { //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, "func" => $this->traceID . ": archive"); $dirArray = array(); $myDirectory; //---------------------------------------------------------- //$this->move(dirname(__FILE__)."/files/videoOrganizer/thumb/",$folderPath.'thumb/'); //$this->move(dirname(__FILE__)."/files/videoOrganizer/",$folderPath); //---------------------------------------------------------- $myDirectory = opendir($this->newVideoRelPath); //---------------------------------------------------------- $this->move($this->newVideoRelPath, $this->newVideoRelPath, " ", "_"); //---------------------------------------------------------- $this->move($this->newThumbRelPath, $this->newThumbRelPath, " ", "_"); //---------------------------------------------------------- while ($entryName = readdir($myDirectory)) { if (stristr($entryName, '.mp4')) { array_push($dirArray, array('title' => $entryName, 'orig_title' => $entryName, 'hash' => GenFun::encrypt($entryName), 'mp4' => $entryName, 'thumbnail_url' => GenFun::str_lreplace(".mp4", ".png", $entryName))); } } //---------------------------------------------------------- $this->move($this->newVideoRelPath, $this->newVideoRelPath, "_", " "); //---------------------------------------------------------- $this->move($this->newThumbRelPath, $this->newThumbRelPath, "_", " "); //---------------------------------------------------------- $chk = $this->_insertContents($dirArray); return $chk; }
function archive($folderPath = NULL) { $folderPath = dirname(__FILE__) . "/files/new_files/"; //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, "func" => "archive"); $dirArray = array(); $myDirectory; //---------------------------------------------------------- //$this->move(dirname(__FILE__)."/files/videoOrganizer/thumb/",$folderPath.'thumb/'); //$this->move(dirname(__FILE__)."/files/videoOrganizer/",$folderPath); //---------------------------------------------------------- $myDirectory = opendir($folderPath); //---------------------------------------------------------- $videoPath = GenFun::get_full_url(dirname(__FILE__)) . "files/videoOrganizer/"; //---------------------------------------------------------- $this->move($folderPath, $folderPath, " ", "_"); //---------------------------------------------------------- $this->move($folderPath . 'thumb/', $folderPath . 'thumb/', " ", "_"); //---------------------------------------------------------- while ($entryName = readdir($myDirectory)) { if (stristr($entryName, '.mp4')) { array_push($dirArray, array('title' => $entryName, 'orig_title' => $entryName, 'hash' => GenFun::encrypt($entryName), 'path' => $videoPath, 'mp4' => $entryName, 'thumbnail_url' => "thumb/" . GenFun::str_lreplace(".mp4", ".png", $entryName))); } } //---------------------------------------------------------- $this->move($folderPath, $folderPath, "_", " "); //---------------------------------------------------------- $this->move($folderPath . 'thumb/', $folderPath . 'thumb/', "_", " "); //---------------------------------------------------------- $this->move($folderPath . 'thumb/', dirname(__FILE__) . "/files/videoOrganizer/thumb/"); $this->move($folderPath, dirname(__FILE__) . "/files/videoOrganizer/"); //---------------------------------------------------------- $chk = $this->_insertContents($dirArray); return $chk; }