original_string: public function read($key)
      {
          $file = $this->_getFilePath($key, true);
  
          $contents = parse_ini_file($file, true);
          if ($this->_section && isset($contents[$this->_section])) {
              $values = $this->_parseNestedValues($contents[$this->_section]);
          } else {
              $values = [];
              foreach ($contents as $section => $attribs) {
                  if (is_array($attribs)) {
                      $values[$section] = $this->_parseNestedValues($attribs);
                  } else {
                      $parse = $this->_parseNestedValues([$attribs]);
                      $values[$section] = array_shift($parse);
                  }
              }
          }
  
          return $values;
      }
code: public function read($key)
      {
          $file = $this->_getFilePath($key, true);
  
          $contents = parse_ini_file($file, true);
          if ($this->_section && isset($contents[$this->_section])) {
              $values = $this->_parseNestedValues($contents[$this->_section]);
          } else {
              $values = [];
              foreach ($contents as $section => $attribs) {
                  if (is_array($attribs)) {
                      $values[$section] = $this->_parseNestedValues($attribs);
                  } else {
                      $parse = $this->_parseNestedValues([$attribs]);
                      $values[$section] = array_shift($parse);
                  }
              }
          }
  
          return $values;
      }
code_tokens: public function read ( $ key ) { $ file = $ this -> _getFilePath ( $ key , true ) ; $ contents = parse_ini_file ( $ file , true ) ; if ( $ this -> _section && isset ( $ contents [ $ this -> _section ] ) ) { $ values = $ this -> _parseNestedValues ( $ contents [ $ this -> _section ] ) ; } else { $ values = [ ] ; foreach ( $ contents as $ section => $ attribs ) { if ( is_array ( $ attribs ) ) { $ values [ $ section ] = $ this -> _parseNestedValues ( $ attribs ) ; } else { $ parse = $ this -> _parseNestedValues ( [ $ attribs ] ) ; $ values [ $ section ] = array_shift ( $ parse ) ; } } } return $ values ; }
docstring: Read an ini file and return the results as an array.
  
  @param string $key The identifier to read from. If the key has a . it will be treated
  as a plugin prefix. The chosen file must be on the engine's path.
  @return array Parsed configuration values.
  @throws \Cake\Core\Exception\Exception when files don't exist.
  Or when files contain '..' as this could lead to abusive reads.
docstring_tokens: Read an ini file and return the results as an array .