ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ.. /** * Abstraction of general file archives. * * @package core_files * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * Each file archive type must extend this class. * * @package core_files * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class file_archive implements Iterator { /** Open archive if exists, fail if does not exist. */ const OPEN = 1; /** Open archive if exists, create if does not. */ const CREATE = 2; /** Always create new archive */ const OVERWRITE = 4; /** @var string Encoding of file names - windows usually expects DOS single-byte charset*/ protected $encoding = 'utf-8'; /** * Open or create archive (depending on $mode). * * @param string $archivepathname archive path name * @param int $mode OPEN, CREATE or OVERWRITE constant * @param string $encoding archive local paths encoding * @return bool success */ public abstract function open($archivepathname, $mode=file_archive::CREATE, $encoding='utf-8'); /** * Close archive. * * @return bool success */ public abstract function close(); /** * Returns file stream for reading of content. * * @param int $index index of file * @return stream|bool stream or false if error */ public abstract function get_stream($index); /** * Returns file information. * * @param int $index index of file * @return stdClass|bool object or false if error */ public abstract function get_info($index); /** * Returns array of info about all files in archive. * * @return array of file infos */ public abstract function list_files(); /** * Returns number of files in archive. * * @return int number of files */ public abstract function count(); /** * Add file into archive. * * @param string $localname name of file in archive * @param string $pathname location of file * @return bool success */ public abstract function add_file_from_pathname($localname, $pathname); /** * Add content of string into archive. * * @param string $localname name of file in archive * @param string $contents contents * @return bool success */ public abstract function add_file_from_string($localname, $contents); /** * Add empty directory into archive. * * @param string $localname name of file in archive * @return bool success */ public abstract function add_directory($localname); /** * Tries to convert $localname into another encoding, * please note that it may fail really badly. * * @param string $localname name of file in utf-8 encoding * @return string */ protected function mangle_pathname($localname) { if ($this->encoding === 'utf-8') { return $localname; } $converted = core_text::convert($localname, 'utf-8', $this->encoding); $original = core_text::convert($converted, $this->encoding, 'utf-8'); if ($original === $localname) { $result = $converted; } else { // try ascii conversion $converted2 = core_text::specialtoascii($localname); $converted2 = core_text::convert($converted2, 'utf-8', $this->encoding); $original2 = core_text::convert($converted, $this->encoding, 'utf-8'); if ($original2 === $localname) { //this looks much better $result = $converted2; } else { //bad luck - the file name may not be usable at all $result = $converted; } } $result = preg_replace('/\.\.+\//', '', $result); // Cleanup any potential ../ transversal (any number of dots). $result = preg_replace('/\.\.+/', '.', $result); // Join together any number of consecutive dots. $result = ltrim($result); // no leading / if ($result === '.') { $result = ''; } return $result; } /** * Tries to convert $localname into utf-8 * please note that it may fail really badly. * The resulting file name is cleaned. * * @param string $localname name of file in $this->encoding * @return string in utf-8 */ protected function unmangle_pathname($localname) { $result = str_replace('\\', '/', $localname); // no MS \ separators $result = ltrim($result, '/'); // no leading / if ($this->encoding !== 'utf-8') { $result = core_text::convert($result, $this->encoding, 'utf-8'); } return clean_param($result, PARAM_PATH); } /** * Returns current file info. * @return object */ //public abstract function current(); /** * Returns the index of current file. * @return int current file index */ //public abstract function key(); /** * Moves forward to next file. * @return void */ //public abstract function next(); /** * Rewinds back to the first file. * @return void */ //public abstract function rewind(); /** * Did we reach the end? * @return boolean */ //public abstract function valid(); }