ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç lang/en/cachelock_file.php000064400000002012152266601160011513 0ustar00. /** * Strings for the cache file locking plugin * * @package cachelock_file * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ $string['pluginname'] = 'File locking'; $string['privacy:metadata'] = 'The File locking plugin does not store any personal data.'; lib.php000064400000021105152266601160006027 0ustar00. /** * File locking for the Cache API * * @package cachelock_file * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * File locking plugin * * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class cachelock_file implements cache_lock_interface { /** * The name of the cache lock instance * @var string */ protected $name; /** * The absolute directory in which lock files will be created and looked for. * @var string */ protected $cachedir; /** * The maximum life in seconds for a lock file. By default null for none. * @var int|null */ protected $maxlife = null; /** * The number of attempts to acquire a lock when blocking is required before throwing an exception. * @var int */ protected $blockattempts = 100; /** * An array containing the locks that have been acquired but not released so far. * @var array Array of key => lock file path */ protected $locks = array(); /** * Initialises the cache lock instance. * * @param string $name The name of the cache lock * @param array $configuration */ public function __construct($name, array $configuration = array()) { $this->name = $name; if (!array_key_exists('dir', $configuration)) { $this->cachedir = make_cache_directory(md5($name)); } else { $dir = $configuration['dir']; if (strpos($dir, '/') !== false && strpos($dir, '.') !== 0) { // This looks like an absolute path. if (file_exists($dir) && is_dir($dir) && is_writable($dir)) { $this->cachedir = $dir; } } if (empty($this->cachedir)) { $dir = preg_replace('#[^a-zA-Z0-9_]#', '_', $dir); $this->cachedir = make_cache_directory($dir); } } if (array_key_exists('maxlife', $configuration) && is_number($configuration['maxlife'])) { $maxlife = (int)$configuration['maxlife']; // Minimum lock time is 60 seconds. $this->maxlife = max($maxlife, 60); } if (array_key_exists('blockattempts', $configuration) && is_number($configuration['blockattempts'])) { $this->blockattempts = (int)$configuration['blockattempts']; } } /** * Acquire a lock. * * If the lock can be acquired: * This function will return true. * * If the lock cannot be acquired the result of this method is determined by the block param: * $block = true (default) * The function will block any further execution unti the lock can be acquired. * This involves the function attempting to acquire the lock and the sleeping for a period of time. This process * will be repeated until the lock is required or until a limit is hit (100 by default) in which case a cache * exception will be thrown. * $block = false * The function will return false immediately. * * If a max life has been specified and the lock can not be acquired then the lock file will be checked against this time. * In the case that the file exceeds that max time it will be forcefully deleted. * Because this can obviously be a dangerous thing it is not used by default. If it is used it should be set high enough that * we can be as sure as possible that the executing code has completed. * * @param string $key The key that we want to lock * @param string $ownerid A unique identifier for the owner of this lock. Not used by default. * @param bool $block True if we want the program block further execution until the lock has been acquired. * @return bool * @throws cache_exception If block is set to true and more than 100 attempts have been made to acquire a lock. */ public function lock($key, $ownerid, $block = false) { // Get the name of the lock file we want to use. $lockfile = $this->get_lock_file($key); // Attempt to create a handle to the lock file. // Mode xb is the secret to this whole function. // x = Creates the file and opens it for writing. If the file already exists fopen returns false and a warning is thrown. // b = Forces binary mode. $result = @fopen($lockfile, 'xb'); // Check if we could create the file or not. if ($result === false) { // Lock exists already. if ($this->maxlife !== null && !array_key_exists($key, $this->locks)) { $mtime = filemtime($lockfile); if ($mtime < time() - $this->maxlife) { $this->unlock($key, true); $result = $this->lock($key, false); if ($result) { return true; } } } if ($block) { // OK we are blocking. We had better sleep and then retry to lock. $iterations = 0; $maxiterations = $this->blockattempts; while (($result = $this->lock($key, false)) === false) { // Usleep causes the application to cleep to x microseconds. // Before anyone asks there are 1'000'000 microseconds to a second. usleep(rand(1000, 50000)); // Sleep between 1 and 50 milliseconds. $iterations++; if ($iterations > $maxiterations) { // BOOM! We've exceeded the maximum number of iterations we want to block for. throw new cache_exception('ex_unabletolock'); } } } return false; } else { // We have the lock. fclose($result); $this->locks[$key] = $lockfile; return true; } } /** * Releases an acquired lock. * * For more details see {@link cache_lock::unlock()} * * @param string $key * @param string $ownerid A unique identifier for the owner of this lock. Not used by default. * @param bool $forceunlock If set to true the lock will be removed if it exists regardless of whether or not we own it. * @return bool */ public function unlock($key, $ownerid, $forceunlock = false) { if (array_key_exists($key, $this->locks)) { @unlink($this->locks[$key]); unset($this->locks[$key]); return true; } else if ($forceunlock) { $lockfile = $this->get_lock_file($key); if (file_exists($lockfile)) { @unlink($lockfile); } return true; } // You cannot unlock a file you didn't lock. return false; } /** * Checks if the given key is locked. * * @param string $key * @param string $ownerid */ public function check_state($key, $ownerid) { if (array_key_exists($key, $this->locks)) { // The key is locked and we own it. return true; } $lockfile = $this->get_lock_file($key); if (file_exists($lockfile)) { // The key is locked and we don't own it. return false; } return null; } /** * Gets the name to use for a lock file. * * @param string $key * @return string */ protected function get_lock_file($key) { return $this->cachedir.'/'. $key .'.lock'; } /** * Cleans up the instance what it is no longer needed. */ public function __destruct() { foreach ($this->locks as $lockfile) { // Naught, naughty developers. @unlink($lockfile); } } } version.php000064400000002237152266601160006753 0ustar00. /** * File locking for the Cache API * * @package cachelock_file * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $plugin->version = 2025041400; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2025040800; // Requires this Moodle version. $plugin->component = 'cachelock_file'; // Full name of the plugin (used for diagnostics) classes/privacy/provider.php000064400000002776152266601160012242 0ustar00. /** * Privacy Subsystem implementation for cachelock_file. * * @package cachelock_file * @copyright 2018 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace cachelock_file\privacy; defined('MOODLE_INTERNAL') || die(); /** * Privacy Subsystem for cachelock_file implementing null_provider. * * @copyright 2018 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class provider implements \core_privacy\local\metadata\null_provider { /** * Get the language string identifier with the component's language * file to explain why this plugin stores no data. * * @return string */ public static function get_reason(): string { return 'privacy:metadata'; } }