original_string: public function findConfigurationFile($filename = null, $pwd = null)
      {
          $filename = $filename ?: $this->getConfigurationFileName();
          $pwd = $pwd ?: getcwd();
          
          $dirs = explode(DS, $pwd);
          $find = false;
          do {
              $dir = join(DS, $dirs);
              $config_file_path = $dir . DS . $filename;
              if (file_exists($config_file_path) && is_file($config_file_path))
                  return $config_file_path;
          } while (array_pop($dirs));
  
          return $pwd . DS . $filename;
      }
code: public function findConfigurationFile($filename = null, $pwd = null)
      {
          $filename = $filename ?: $this->getConfigurationFileName();
          $pwd = $pwd ?: getcwd();
          
          $dirs = explode(DS, $pwd);
          $find = false;
          do {
              $dir = join(DS, $dirs);
              $config_file_path = $dir . DS . $filename;
              if (file_exists($config_file_path) && is_file($config_file_path))
                  return $config_file_path;
          } while (array_pop($dirs));
  
          return $pwd . DS . $filename;
      }
code_tokens: public function findConfigurationFile ( $ filename = null , $ pwd = null ) { $ filename = $ filename ? : $ this -> getConfigurationFileName ( ) ; $ pwd = $ pwd ? : getcwd ( ) ; $ dirs = explode ( DS , $ pwd ) ; $ find = false ; do { $ dir = join ( DS , $ dirs ) ; $ config_file_path = $ dir . DS . $ filename ; if ( file_exists ( $ config_file_path ) && is_file ( $ config_file_path ) ) return $ config_file_path ; } while ( array_pop ( $ dirs ) ) ; return $ pwd . DS . $ filename ; }
docstring: find configuration file
  
  @param   string  $filename
  @param   string  $pwd
  @return  string
docstring_tokens: find configuration file