original_string: public function missing_dependencies($availableonly=false) {
  
          $dependencies = array();
  
          foreach ($this->get_plugins() as $plugintype => $pluginfos) {
              foreach ($pluginfos as $pluginname => $pluginfo) {
                  foreach ($this->resolve_requirements($pluginfo) as $reqname => $reqinfo) {
                      if ($reqname === 'core') {
                          continue;
                      }
                      if ($reqinfo->status != self::REQUIREMENT_STATUS_OK) {
                          if ($reqinfo->availability == self::REQUIREMENT_AVAILABLE) {
                              $remoteinfo = $this->get_remote_plugin_info($reqname, $reqinfo->reqver, false);
  
                              if (empty($dependencies[$reqname])) {
                                  $dependencies[$reqname] = $remoteinfo;
                              } else {
                                  // If resolving requirements has led to two different versions of the same
                                  // remote plugin, pick the higher version. This can happen in cases like one
                                  // plugin requiring ANY_VERSION and another plugin requiring specific higher
                                  // version with lower maturity of a remote plugin.
                                  if ($remoteinfo->version->version > $dependencies[$reqname]->version->version) {
                                      $dependencies[$reqname] = $remoteinfo;
                                  }
                              }
  
                          } else {
                              if (!isset($dependencies[$reqname])) {
                                  // Unable to find a plugin fulfilling the requirements.
                                  $dependencies[$reqname] = false;
                              }
                          }
                      }
                  }
              }
          }
  
          if ($availableonly) {
              foreach ($dependencies as $component => $info) {
                  if (empty($info) or empty($info->version)) {
                      unset($dependencies[$component]);
                  }
              }
          }
  
          return $dependencies;
      }
code: public function missing_dependencies($availableonly=false) {
  
          $dependencies = array();
  
          foreach ($this->get_plugins() as $plugintype => $pluginfos) {
              foreach ($pluginfos as $pluginname => $pluginfo) {
                  foreach ($this->resolve_requirements($pluginfo) as $reqname => $reqinfo) {
                      if ($reqname === 'core') {
                          continue;
                      }
                      if ($reqinfo->status != self::REQUIREMENT_STATUS_OK) {
                          if ($reqinfo->availability == self::REQUIREMENT_AVAILABLE) {
                              $remoteinfo = $this->get_remote_plugin_info($reqname, $reqinfo->reqver, false);
  
                              if (empty($dependencies[$reqname])) {
                                  $dependencies[$reqname] = $remoteinfo;
                              } else {
                                  // If resolving requirements has led to two different versions of the same
                                  // remote plugin, pick the higher version. This can happen in cases like one
                                  // plugin requiring ANY_VERSION and another plugin requiring specific higher
                                  // version with lower maturity of a remote plugin.
                                  if ($remoteinfo->version->version > $dependencies[$reqname]->version->version) {
                                      $dependencies[$reqname] = $remoteinfo;
                                  }
                              }
  
                          } else {
                              if (!isset($dependencies[$reqname])) {
                                  // Unable to find a plugin fulfilling the requirements.
                                  $dependencies[$reqname] = false;
                              }
                          }
                      }
                  }
              }
          }
  
          if ($availableonly) {
              foreach ($dependencies as $component => $info) {
                  if (empty($info) or empty($info->version)) {
                      unset($dependencies[$component]);
                  }
              }
          }
  
          return $dependencies;
      }
code_tokens: public function missing_dependencies ( $ availableonly = false ) { $ dependencies = array ( ) ; foreach ( $ this -> get_plugins ( ) as $ plugintype => $ pluginfos ) { foreach ( $ pluginfos as $ pluginname => $ pluginfo ) { foreach ( $ this -> resolve_requirements ( $ pluginfo ) as $ reqname => $ reqinfo ) { if ( $ reqname === 'core' ) { continue ; } if ( $ reqinfo -> status != self :: REQUIREMENT_STATUS_OK ) { if ( $ reqinfo -> availability == self :: REQUIREMENT_AVAILABLE ) { $ remoteinfo = $ this -> get_remote_plugin_info ( $ reqname , $ reqinfo -> reqver , false ) ; if ( empty ( $ dependencies [ $ reqname ] ) ) { $ dependencies [ $ reqname ] = $ remoteinfo ; } else { // If resolving requirements has led to two different versions of the same // remote plugin, pick the higher version. This can happen in cases like one // plugin requiring ANY_VERSION and another plugin requiring specific higher // version with lower maturity of a remote plugin. if ( $ remoteinfo -> version -> version > $ dependencies [ $ reqname ] -> version -> version ) { $ dependencies [ $ reqname ] = $ remoteinfo ; } } } else { if ( ! isset ( $ dependencies [ $ reqname ] ) ) { // Unable to find a plugin fulfilling the requirements. $ dependencies [ $ reqname ] = false ; } } } } } } if ( $ availableonly ) { foreach ( $ dependencies as $ component => $ info ) { if ( empty ( $ info ) or empty ( $ info -> version ) ) { unset ( $ dependencies [ $ component ] ) ; } } } return $ dependencies ; }
docstring: Return a list of missing dependencies.
  
  This should provide the full list of plugins that should be installed to
  fulfill the requirements of all plugins, if possible.
  
  @param bool $availableonly return only available missing dependencies
  @return array of \core\update\remote_info|bool indexed by the component name
docstring_tokens: Return a list of missing dependencies .