Inherited by Doctrine_Parser_Json, Doctrine_Parser_Serialize, Doctrine_Parser_Xml, and Doctrine_Parser_Yml.
|
| static | dump ($array, $type= 'xml', $path=null, $charset=null) |
| |
| static | getParser ($type) |
| |
| static | load ($path, $type= 'xml') |
| |
Definition at line 33 of file Parser.php.
| Doctrine_Parser::doDump |
( |
|
$data, |
|
|
|
$path = null |
|
) |
| |
doDump
- Parameters
-
- Returns
- void
Definition at line 145 of file Parser.php.
{
if ($path !== null) {
return file_put_contents($path, $data);
} else {
return $data;
}
}
| Doctrine_Parser::doLoad |
( |
|
$path | ) |
|
doLoad
Get contents whether it is the path to a file file or a string of txt. Either should allow php code in it.
- Parameters
-
- Returns
- void
Definition at line 120 of file Parser.php.
{
ob_start();
if ( ! file_exists($path)) {
$contents = $path;
$path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'dparser_' . microtime();
file_put_contents($path, $contents);
}
include($path);
$contents = ob_get_clean();
return $contents;
}
| static Doctrine_Parser::dump |
( |
|
$array, |
|
|
|
$type = 'xml', |
|
|
|
$path = null, |
|
|
|
$charset = null |
|
) |
| |
|
static |
dump
Interface for pulling and dumping data to a file
- Parameters
-
| string | $array | |
| string | $path | |
| string | $type | |
| string | $charset | The charset of the data being dumped |
- Returns
- void
- Author
- Jonathan H. Wage
Definition at line 104 of file Parser.php.
{
$parser = self::getParser($type);
return $parser->dumpData($array, $path, $charset);
}
| Doctrine_Parser::dumpData |
( |
|
$array, |
|
|
|
$path = null, |
|
|
|
$charset = null |
|
) |
| |
|
abstract |
dumpData
Override in the parser driver
- Parameters
-
| string | $array | |
| string | $path | |
| string | $charset | The charset of the data being dumped |
- Returns
- void
- Author
- Jonathan H. Wage
| static Doctrine_Parser::getParser |
( |
|
$type | ) |
|
|
static |
getParser
Get instance of the specified parser
- Parameters
-
- Returns
- void
- Author
- Jonathan H. Wage
Definition at line 68 of file Parser.php.
{
$class = 'Doctrine_Parser_'.ucfirst($type);
return new $class;
}
| static Doctrine_Parser::load |
( |
|
$path, |
|
|
|
$type = 'xml' |
|
) |
| |
|
static |
load
Interface for loading and parsing data from a file
- Parameters
-
- Returns
- void
- Author
- Jonathan H. Wage
Definition at line 85 of file Parser.php.
{
$parser = self::getParser($type);
return (array) $parser->loadData($path);
}
| Doctrine_Parser::loadData |
( |
|
$array | ) |
|
|
abstract |
loadData
Override in the parser driver
- Parameters
-
- Returns
- void
- Author
- Jonathan H. Wage
The documentation for this class was generated from the following file: