original_string: protected function _list($name = null)
      {
          if ($name === null) {
              $pluginsList = Plugin::loaded();
          } else {
              if (!Plugin::isLoaded($name)) {
                  $this->err(sprintf('Plugin %s is not loaded.', $name));
  
                  return [];
              }
              $pluginsList = [$name];
          }
  
          $plugins = [];
  
          foreach ($pluginsList as $plugin) {
              $path = Plugin::path($plugin) . 'webroot';
              if (!is_dir($path)) {
                  $this->verbose('', 1);
                  $this->verbose(
                      sprintf('Skipping plugin %s. It does not have webroot folder.', $plugin),
                      2
                  );
                  continue;
              }
  
              $link = Inflector::underscore($plugin);
              $dir = WWW_ROOT;
              $namespaced = false;
              if (strpos($link, '/') !== false) {
                  $namespaced = true;
                  $parts = explode('/', $link);
                  $link = array_pop($parts);
                  $dir = WWW_ROOT . implode(DIRECTORY_SEPARATOR, $parts) . DIRECTORY_SEPARATOR;
              }
  
              $plugins[$plugin] = [
                  'srcPath' => Plugin::path($plugin) . 'webroot',
                  'destDir' => $dir,
                  'link' => $link,
                  'namespaced' => $namespaced
              ];
          }
  
          return $plugins;
      }
code: protected function _list($name = null)
      {
          if ($name === null) {
              $pluginsList = Plugin::loaded();
          } else {
              if (!Plugin::isLoaded($name)) {
                  $this->err(sprintf('Plugin %s is not loaded.', $name));
  
                  return [];
              }
              $pluginsList = [$name];
          }
  
          $plugins = [];
  
          foreach ($pluginsList as $plugin) {
              $path = Plugin::path($plugin) . 'webroot';
              if (!is_dir($path)) {
                  $this->verbose('', 1);
                  $this->verbose(
                      sprintf('Skipping plugin %s. It does not have webroot folder.', $plugin),
                      2
                  );
                  continue;
              }
  
              $link = Inflector::underscore($plugin);
              $dir = WWW_ROOT;
              $namespaced = false;
              if (strpos($link, '/') !== false) {
                  $namespaced = true;
                  $parts = explode('/', $link);
                  $link = array_pop($parts);
                  $dir = WWW_ROOT . implode(DIRECTORY_SEPARATOR, $parts) . DIRECTORY_SEPARATOR;
              }
  
              $plugins[$plugin] = [
                  'srcPath' => Plugin::path($plugin) . 'webroot',
                  'destDir' => $dir,
                  'link' => $link,
                  'namespaced' => $namespaced
              ];
          }
  
          return $plugins;
      }
code_tokens: protected function _list ( $ name = null ) { if ( $ name === null ) { $ pluginsList = Plugin :: loaded ( ) ; } else { if ( ! Plugin :: isLoaded ( $ name ) ) { $ this -> err ( sprintf ( 'Plugin %s is not loaded.' , $ name ) ) ; return [ ] ; } $ pluginsList = [ $ name ] ; } $ plugins = [ ] ; foreach ( $ pluginsList as $ plugin ) { $ path = Plugin :: path ( $ plugin ) . 'webroot' ; if ( ! is_dir ( $ path ) ) { $ this -> verbose ( '' , 1 ) ; $ this -> verbose ( sprintf ( 'Skipping plugin %s. It does not have webroot folder.' , $ plugin ) , 2 ) ; continue ; } $ link = Inflector :: underscore ( $ plugin ) ; $ dir = WWW_ROOT ; $ namespaced = false ; if ( strpos ( $ link , '/' ) !== false ) { $ namespaced = true ; $ parts = explode ( '/' , $ link ) ; $ link = array_pop ( $ parts ) ; $ dir = WWW_ROOT . implode ( DIRECTORY_SEPARATOR , $ parts ) . DIRECTORY_SEPARATOR ; } $ plugins [ $ plugin ] = [ 'srcPath' => Plugin :: path ( $ plugin ) . 'webroot' , 'destDir' => $ dir , 'link' => $ link , 'namespaced' => $ namespaced ] ; } return $ plugins ; }
docstring: Get list of plugins to process. Plugins without a webroot directory are skipped.
  
  @param string|null $name Name of plugin for which to symlink assets.
  If null all plugins will be processed.
  @return array List of plugins with meta data.
docstring_tokens: Get list of plugins to process . Plugins without a webroot directory are skipped .