original_string: public static function get_plugin_list_with_file($plugintype, $file, $include = false) {
          global $CFG; // Necessary in case it is referenced by included PHP scripts.
          $pluginfiles = array();
  
          if (isset(self::$filemap[$file])) {
              // If the file was supposed to be mapped, then it should have been set in the array.
              if (isset(self::$filemap[$file][$plugintype])) {
                  $pluginfiles = self::$filemap[$file][$plugintype];
              }
          } else {
              // Old-style search for non-cached files.
              $plugins = self::get_plugin_list($plugintype);
              foreach ($plugins as $plugin => $fulldir) {
                  $path = $fulldir . '/' . $file;
                  if (file_exists($path)) {
                      $pluginfiles[$plugin] = $path;
                  }
              }
          }
  
          if ($include) {
              foreach ($pluginfiles as $path) {
                  include_once($path);
              }
          }
  
          return $pluginfiles;
      }
code: public static function get_plugin_list_with_file($plugintype, $file, $include = false) {
          global $CFG; // Necessary in case it is referenced by included PHP scripts.
          $pluginfiles = array();
  
          if (isset(self::$filemap[$file])) {
              // If the file was supposed to be mapped, then it should have been set in the array.
              if (isset(self::$filemap[$file][$plugintype])) {
                  $pluginfiles = self::$filemap[$file][$plugintype];
              }
          } else {
              // Old-style search for non-cached files.
              $plugins = self::get_plugin_list($plugintype);
              foreach ($plugins as $plugin => $fulldir) {
                  $path = $fulldir . '/' . $file;
                  if (file_exists($path)) {
                      $pluginfiles[$plugin] = $path;
                  }
              }
          }
  
          if ($include) {
              foreach ($pluginfiles as $path) {
                  include_once($path);
              }
          }
  
          return $pluginfiles;
      }
code_tokens: public static function get_plugin_list_with_file ( $ plugintype , $ file , $ include = false ) { global $ CFG ; // Necessary in case it is referenced by included PHP scripts. $ pluginfiles = array ( ) ; if ( isset ( self :: $ filemap [ $ file ] ) ) { // If the file was supposed to be mapped, then it should have been set in the array. if ( isset ( self :: $ filemap [ $ file ] [ $ plugintype ] ) ) { $ pluginfiles = self :: $ filemap [ $ file ] [ $ plugintype ] ; } } else { // Old-style search for non-cached files. $ plugins = self :: get_plugin_list ( $ plugintype ) ; foreach ( $ plugins as $ plugin => $ fulldir ) { $ path = $ fulldir . '/' . $ file ; if ( file_exists ( $ path ) ) { $ pluginfiles [ $ plugin ] = $ path ; } } } if ( $ include ) { foreach ( $ pluginfiles as $ path ) { include_once ( $ path ) ; } } return $ pluginfiles ; }
docstring: Get a list of all the plugins of a given type that contain a particular file.
  
  @param string $plugintype the type of plugin, e.g. 'mod' or 'report'.
  @param string $file the name of file that must be present in the plugin.
  (e.g. 'view.php', 'db/install.xml').
  @param bool $include if true (default false), the file will be include_once-ed if found.
  @return array with plugin name as keys (e.g. 'forum', 'courselist') and the path
  to the file relative to dirroot as value (e.g. "$CFG->dirroot/mod/forum/view.php").
docstring_tokens: Get a list of all the plugins of a given type that contain a particular file .