|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 // This file is part of Moodle - http://moodle.org/ 00004 // 00005 // Moodle is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // Moodle is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00017 00018 00028 defined('MOODLE_INTERNAL') || die(); 00029 00039 class virtual_root_file { 00040 protected $contextid; 00041 protected $component; 00042 protected $filearea; 00043 protected $itemid; 00044 00048 public function __construct($contextid, $component, $filearea, $itemid) { 00049 $this->contextid = $contextid; 00050 $this->component = $component; 00051 $this->filearea = $filearea; 00052 $this->itemid = $itemid; 00053 } 00054 00059 public function is_directory() { 00060 return true; 00061 } 00062 00067 public function delete() { 00068 return true; 00069 } 00070 00077 public function add_to_curl_request(&$curlrequest, $key) { 00078 return; 00079 } 00080 00085 public function get_content_file_handle() { 00086 return null; 00087 } 00088 00093 public function readfile() { 00094 return; 00095 } 00096 00101 public function get_content() { 00102 return ''; 00103 } 00104 00110 public function copy_content_to($pathname) { 00111 return false; 00112 } 00113 00119 public function list_files(file_packer $packer) { 00120 return null; 00121 } 00122 00129 public function extract_to_pathname(file_packer $packer, $pathname) { 00130 return false; 00131 } 00132 00144 public function extract_to_storage(file_packer $packer, $contextid, $component, $filearea, $itemid, $pathbase, $userid = NULL) { 00145 return false; 00146 } 00147 00154 public function archive_file(file_archive $filearch, $archivepath) { 00155 return false; 00156 } 00157 00162 public function get_parent_directory() { 00163 return null; 00164 } 00165 00166 public function get_contextid() { 00167 return $this->contextid; 00168 } 00169 00170 public function get_component() { 00171 return $this->component; 00172 } 00173 00174 public function get_filearea() { 00175 return $this->filearea; 00176 } 00177 00178 public function get_itemid() { 00179 return $this->itemid; 00180 } 00181 00182 public function get_filepath() { 00183 return '/'; 00184 } 00185 00186 public function get_filename() { 00187 return '.'; 00188 } 00189 00190 public function get_userid() { 00191 return null; 00192 } 00193 00194 public function get_filesize() { 00195 return 0; 00196 } 00197 00198 public function get_mimetype() { 00199 return null; 00200 } 00201 00202 public function get_timecreated() { 00203 return 0; 00204 } 00205 00206 public function get_timemodified() { 00207 return 0; 00208 } 00209 00210 public function get_status() { 00211 return 0; 00212 } 00213 00214 public function get_id() { 00215 return 0; 00216 } 00217 00218 public function get_contenthash() { 00219 return sha1(''); 00220 } 00221 00222 public function get_pathnamehash() { 00223 return sha1('/'.$this->get_contextid().'/'.$this->get_component().'/'.$this->get_filearea().'/'.$this->get_itemid().$this->get_filepath().$this->get_filename()); 00224 } 00225 00226 public function get_license() { 00227 return null; 00228 } 00229 00230 public function get_author() { 00231 return null; 00232 } 00233 00234 public function get_source() { 00235 return null; 00236 } 00237 00238 public function get_sortorder() { 00239 return null; 00240 } 00241 }