original_string: public function findPath($name)
      {
          $this->loadConfig();
  
          $path = Configure::read('plugins.' . $name);
          if ($path) {
              return $path;
          }
  
          $pluginPath = str_replace('/', DIRECTORY_SEPARATOR, $name);
          $paths = App::path('Plugin');
          foreach ($paths as $path) {
              if (is_dir($path . $pluginPath)) {
                  return $path . $pluginPath . DIRECTORY_SEPARATOR;
              }
          }
  
          throw new MissingPluginException(['plugin' => $name]);
      }
code: public function findPath($name)
      {
          $this->loadConfig();
  
          $path = Configure::read('plugins.' . $name);
          if ($path) {
              return $path;
          }
  
          $pluginPath = str_replace('/', DIRECTORY_SEPARATOR, $name);
          $paths = App::path('Plugin');
          foreach ($paths as $path) {
              if (is_dir($path . $pluginPath)) {
                  return $path . $pluginPath . DIRECTORY_SEPARATOR;
              }
          }
  
          throw new MissingPluginException(['plugin' => $name]);
      }
code_tokens: public function findPath ( $ name ) { $ this -> loadConfig ( ) ; $ path = Configure :: read ( 'plugins.' . $ name ) ; if ( $ path ) { return $ path ; } $ pluginPath = str_replace ( '/' , DIRECTORY_SEPARATOR , $ name ) ; $ paths = App :: path ( 'Plugin' ) ; foreach ( $ paths as $ path ) { if ( is_dir ( $ path . $ pluginPath ) ) { return $ path . $ pluginPath . DIRECTORY_SEPARATOR ; } } throw new MissingPluginException ( [ 'plugin' => $ name ] ) ; }
docstring: Locate a plugin path by looking at configuration data.
  
  This will use the `plugins` Configure key, and fallback to enumerating `App::path('Plugin')`
  
  This method is not part of the official public API as plugins with
  no plugin class are being phased out.
  
  @param string $name The plugin name to locate a path for. Will return '' when a plugin cannot be found.
  @return string
  @throws \Cake\Core\Exception\MissingPluginException when a plugin path cannot be resolved.
  @internal
docstring_tokens: Locate a plugin path by looking at configuration data .