Inherits Doctrine_Parser.
|
| static | dump ($array, $type= 'xml', $path=null, $charset=null) |
| |
| static | getParser ($type) |
| |
| static | load ($path, $type= 'xml') |
| |
Definition at line 33 of file Yml.php.
| Doctrine_Parser::doDump |
( |
|
$data, |
|
|
|
$path = null |
|
) |
| |
|
inherited |
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 | ) |
|
|
inherited |
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 |
|
) |
| |
|
staticinherited |
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_Yml::dumpData |
( |
|
$array, |
|
|
|
$path = null, |
|
|
|
$charset = null |
|
) |
| |
dumpData
Dump an array of data to a specified path or return
- Exceptions
-
- Parameters
-
| string | $array | Array of data to dump to yaml |
| string | $path | Path to dump the yaml to |
- Returns
- string $yaml
-
void
Definition at line 46 of file Yml.php.
{
try {
return $this->
doDump($data, $path);
} catch(InvalidArgumentException $e) {
throw $rethrowed_exception;
}
}
| static Doctrine_Parser::getParser |
( |
|
$type | ) |
|
|
staticinherited |
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' |
|
) |
| |
|
staticinherited |
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_Yml::loadData |
( |
|
$path | ) |
|
loadData
Load and parse data from a yml file
- Exceptions
-
- Parameters
-
| string | $path | Path to load yaml data from |
- Returns
- array $array Array of parsed yaml data
Definition at line 71 of file Yml.php.
{
try {
$contents = $this->
doLoad($path);
return $array;
} catch(InvalidArgumentException $e) {
throw $rethrowed_exception;
}
}
The documentation for this class was generated from the following file:
- Doctrine-1.2.4/Doctrine/Parser/Yml.php