original_string: public function getConfigPath($fileName, $configPath = null)
      {
          if (!isset($this->configPath)) {
              $this->configPath = $this->guessConfigPath();
          }
  
          if (!$configPath) {
              $configPath = $this->configPath;
          }
  
          $fileName = File::symbolizePath($fileName);
  
          if (File::isLocalPath($fileName) ||
              (!Config::get('cms.restrictBaseDir', true) && realpath($fileName) !== false)
          ) {
              return $fileName;
          }
  
          if (!is_array($configPath)) {
              $configPath = [$configPath];
          }
  
          foreach ($configPath as $path) {
              $_fileName = $path . '/' . $fileName;
              if (File::isFile($_fileName)) {
                  return $_fileName;
              }
          }
  
          return $fileName;
      }
code: public function getConfigPath($fileName, $configPath = null)
      {
          if (!isset($this->configPath)) {
              $this->configPath = $this->guessConfigPath();
          }
  
          if (!$configPath) {
              $configPath = $this->configPath;
          }
  
          $fileName = File::symbolizePath($fileName);
  
          if (File::isLocalPath($fileName) ||
              (!Config::get('cms.restrictBaseDir', true) && realpath($fileName) !== false)
          ) {
              return $fileName;
          }
  
          if (!is_array($configPath)) {
              $configPath = [$configPath];
          }
  
          foreach ($configPath as $path) {
              $_fileName = $path . '/' . $fileName;
              if (File::isFile($_fileName)) {
                  return $_fileName;
              }
          }
  
          return $fileName;
      }
code_tokens: public function getConfigPath ( $ fileName , $ configPath = null ) { if ( ! isset ( $ this -> configPath ) ) { $ this -> configPath = $ this -> guessConfigPath ( ) ; } if ( ! $ configPath ) { $ configPath = $ this -> configPath ; } $ fileName = File :: symbolizePath ( $ fileName ) ; if ( File :: isLocalPath ( $ fileName ) || ( ! Config :: get ( 'cms.restrictBaseDir' , true ) && realpath ( $ fileName ) !== false ) ) { return $ fileName ; } if ( ! is_array ( $ configPath ) ) { $ configPath = [ $ configPath ] ; } foreach ( $ configPath as $ path ) { $ _fileName = $ path . '/' . $ fileName ; if ( File :: isFile ( $ _fileName ) ) { return $ _fileName ; } } return $ fileName ; }
docstring: Locates a file based on it's definition. If the file starts with
  the ~ symbol it will be returned in context of the application base path,
  otherwise it will be returned in context of the config path.
  @param string $fileName File to load.
  @param mixed $configPath Explicitly define a config path.
  @return string Full path to the config file.
docstring_tokens: Locates a file based on it s definition . If the file starts with the ~ symbol it will be returned in context of the application base path otherwise it will be returned in context of the config path .