original_string: public static function getPluginDirectory($pluginName)
      {
          if (isset(self::$pluginsToPathCache[$pluginName])) {
              return self::$pluginsToPathCache[$pluginName];
          }
  
          $corePluginsDir = PIWIK_INCLUDE_PATH . '/plugins/' . $pluginName;
          if (is_dir($corePluginsDir)) {
              // for faster performance
              self::$pluginsToPathCache[$pluginName] = self::getPluginRealPath($corePluginsDir);
              return self::$pluginsToPathCache[$pluginName];
          }
  
          foreach (self::getPluginsDirectories() as $dir) {
              $path = $dir . $pluginName;
              if (is_dir($path)) {
                  self::$pluginsToPathCache[$pluginName] = self::getPluginRealPath($path);
                  return $path;
              }
          }
  
          // assume default directory when plugin does not exist just yet
          return self::getPluginsDirectory() . $pluginName;
      }
code: public static function getPluginDirectory($pluginName)
      {
          if (isset(self::$pluginsToPathCache[$pluginName])) {
              return self::$pluginsToPathCache[$pluginName];
          }
  
          $corePluginsDir = PIWIK_INCLUDE_PATH . '/plugins/' . $pluginName;
          if (is_dir($corePluginsDir)) {
              // for faster performance
              self::$pluginsToPathCache[$pluginName] = self::getPluginRealPath($corePluginsDir);
              return self::$pluginsToPathCache[$pluginName];
          }
  
          foreach (self::getPluginsDirectories() as $dir) {
              $path = $dir . $pluginName;
              if (is_dir($path)) {
                  self::$pluginsToPathCache[$pluginName] = self::getPluginRealPath($path);
                  return $path;
              }
          }
  
          // assume default directory when plugin does not exist just yet
          return self::getPluginsDirectory() . $pluginName;
      }
code_tokens: public static function getPluginDirectory ( $ pluginName ) { if ( isset ( self :: $ pluginsToPathCache [ $ pluginName ] ) ) { return self :: $ pluginsToPathCache [ $ pluginName ] ; } $ corePluginsDir = PIWIK_INCLUDE_PATH . '/plugins/' . $ pluginName ; if ( is_dir ( $ corePluginsDir ) ) { // for faster performance self :: $ pluginsToPathCache [ $ pluginName ] = self :: getPluginRealPath ( $ corePluginsDir ) ; return self :: $ pluginsToPathCache [ $ pluginName ] ; } foreach ( self :: getPluginsDirectories ( ) as $ dir ) { $ path = $ dir . $ pluginName ; if ( is_dir ( $ path ) ) { self :: $ pluginsToPathCache [ $ pluginName ] = self :: getPluginRealPath ( $ path ) ; return $ path ; } } // assume default directory when plugin does not exist just yet return self :: getPluginsDirectory ( ) . $ pluginName ; }
docstring: Gets the path to a specific plugin. If the plugin does not exist in any plugins folder, the default plugins
  folder will be assumed.
  
  @param $pluginName
  @return mixed|string
  @api
docstring_tokens: Gets the path to a specific plugin . If the plugin does not exist in any plugins folder the default plugins folder will be assumed .