original_string: public function setting_file_serve($filearea, $args, $forcedownload, $options) {
          global $CFG;
          require_once("$CFG->libdir/filelib.php");
  
          $syscontext = context_system::instance();
          $component = 'theme_'.$this->name;
  
          $revision = array_shift($args);
          if ($revision < 0) {
              $lifetime = 0;
          } else {
              $lifetime = 60*60*24*60;
              // By default, theme files must be cache-able by both browsers and proxies.
              if (!array_key_exists('cacheability', $options)) {
                  $options['cacheability'] = 'public';
              }
          }
  
          $fs = get_file_storage();
          $relativepath = implode('/', $args);
  
          $fullpath = "/{$syscontext->id}/{$component}/{$filearea}/0/{$relativepath}";
          $fullpath = rtrim($fullpath, '/');
          if ($file = $fs->get_file_by_hash(sha1($fullpath))) {
              send_stored_file($file, $lifetime, 0, $forcedownload, $options);
              return true;
          } else {
              send_file_not_found();
          }
      }
code: public function setting_file_serve($filearea, $args, $forcedownload, $options) {
          global $CFG;
          require_once("$CFG->libdir/filelib.php");
  
          $syscontext = context_system::instance();
          $component = 'theme_'.$this->name;
  
          $revision = array_shift($args);
          if ($revision < 0) {
              $lifetime = 0;
          } else {
              $lifetime = 60*60*24*60;
              // By default, theme files must be cache-able by both browsers and proxies.
              if (!array_key_exists('cacheability', $options)) {
                  $options['cacheability'] = 'public';
              }
          }
  
          $fs = get_file_storage();
          $relativepath = implode('/', $args);
  
          $fullpath = "/{$syscontext->id}/{$component}/{$filearea}/0/{$relativepath}";
          $fullpath = rtrim($fullpath, '/');
          if ($file = $fs->get_file_by_hash(sha1($fullpath))) {
              send_stored_file($file, $lifetime, 0, $forcedownload, $options);
              return true;
          } else {
              send_file_not_found();
          }
      }
code_tokens: public function setting_file_serve ( $ filearea , $ args , $ forcedownload , $ options ) { global $ CFG ; require_once ( "$CFG->libdir/filelib.php" ) ; $ syscontext = context_system :: instance ( ) ; $ component = 'theme_' . $ this -> name ; $ revision = array_shift ( $ args ) ; if ( $ revision < 0 ) { $ lifetime = 0 ; } else { $ lifetime = 60 * 60 * 24 * 60 ; // By default, theme files must be cache-able by both browsers and proxies. if ( ! array_key_exists ( 'cacheability' , $ options ) ) { $ options [ 'cacheability' ] = 'public' ; } } $ fs = get_file_storage ( ) ; $ relativepath = implode ( '/' , $ args ) ; $ fullpath = "/{$syscontext->id}/{$component}/{$filearea}/0/{$relativepath}" ; $ fullpath = rtrim ( $ fullpath , '/' ) ; if ( $ file = $ fs -> get_file_by_hash ( sha1 ( $ fullpath ) ) ) { send_stored_file ( $ file , $ lifetime , 0 , $ forcedownload , $ options ) ; return true ; } else { send_file_not_found ( ) ; } }
docstring: Serve the theme setting file.
  
  @param string $filearea
  @param array $args
  @param bool $forcedownload
  @param array $options
  @return bool may terminate if file not found or donotdie not specified
docstring_tokens: Serve the theme setting file .