| [ Index ] |
|
Code source de Horde 3.1.3 |
[Code source] [Imprimer] [Statistiques]
(pas de description)
| Poids: | 498 lignes (17 kb) |
| Inclus ou requis: | 0 fois |
| Référencé: | 0 fois |
| Nécessite: | 0 fichiers |
File_CSV:: (9 méthodes):
discoverFormat()
read()
readQuoted()
write()
unquote()
_line()
warning()
getPointer()
_checkConfig()
| discoverFormat($file, $extraSeps = array() X-Ref |
| Discovers the format of a CSV file (the number of fields, the separator, the quote string, and the line break). We can't use the auto_detect_line_endings PHP setting, because it's not supported by fgets() contrary to what the manual says. param: string The CSV file name param: array Extra separators that should be checked for. return: array The format hash. |
| read($file, &$conf) X-Ref |
| Reads a row from a CSV file and returns it as an array. param: string $file The name of the CSV file. param: array $conf The configuration for the CSV file. return: array|boolean The CSV data or false if no more data available. |
| readQuoted($file, &$conf) X-Ref |
| Reads a row from a CSV file and returns it as an array. This method is able to read fields with multiline data and normalizes linebreaks to single newline characters (0x0a). param: string $file The name of the CSV file. param: array $conf The configuration for the CSV file. return: array|boolean The CSV data or false if no more data available. |
| write($file, $fields, &$conf) X-Ref |
| Writes a hash into a CSV file. param: string $file The name of the CSV file. param: array $fields The CSV data. param: array $conf The configuration for the CSV file. return: boolean True on success, PEAR_Error on failure. |
| unquote($field, $quote, $crlf) X-Ref |
| Removes surrounding quotes from a string and normalizes linebreaks. param: string $field The string to unquote. param: string $quote The quote character. param: string $crlf The linebreak character. return: string The unquoted data. |
| _line($line = null) X-Ref |
| Sets or gets the current line being parsed. param: integer $line If specified, the current line. return: integer The current line. |
| warning($warning = null) X-Ref |
| Adds a warning to or retrieves and resets the warning stack. param: string A warning string. If not specified, the existing return: array If no parameter has been specified, the list of existing |
| getPointer($file, &$conf, $mode = FILE_MODE_READ) X-Ref |
| Returns or creates the file descriptor associated with a file. param: string $file The name of the file param: array $conf The configuration param: string $mode The open mode. FILE_MODE_READ or FILE_MODE_WRITE. return: resource The file resource or PEAR_Error on error. |
| _checkConfig(&$conf) X-Ref |
| Checks the configuration given by the user. param: array $conf The configuration assoc array param: string $error The error will be written here if any |
| Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |