Commit 32c62881 authored by Jonathan.Wage's avatar Jonathan.Wage

Fixes #600

parent 43c8eba2
...@@ -67,7 +67,7 @@ abstract class Doctrine_Parser ...@@ -67,7 +67,7 @@ abstract class Doctrine_Parser
static public function getParser($type) static public function getParser($type)
{ {
$class = 'Doctrine_Parser_'.ucfirst($type); $class = 'Doctrine_Parser_'.ucfirst($type);
return new $class; return new $class;
} }
...@@ -84,7 +84,7 @@ abstract class Doctrine_Parser ...@@ -84,7 +84,7 @@ abstract class Doctrine_Parser
static public function load($path, $type = 'xml') static public function load($path, $type = 'xml')
{ {
$parser = self::getParser($type); $parser = self::getParser($type);
return $parser->loadData($path); return $parser->loadData($path);
} }
...@@ -102,7 +102,7 @@ abstract class Doctrine_Parser ...@@ -102,7 +102,7 @@ abstract class Doctrine_Parser
static public function dump($array, $type = 'xml', $path = null) static public function dump($array, $type = 'xml', $path = null)
{ {
$parser = self::getParser($type); $parser = self::getParser($type);
return $parser->dumpData($array, $path); return $parser->dumpData($array, $path);
} }
...@@ -120,17 +120,17 @@ abstract class Doctrine_Parser ...@@ -120,17 +120,17 @@ abstract class Doctrine_Parser
ob_start(); ob_start();
if ( ! file_exists($path)) { if ( ! file_exists($path)) {
$contents = $path; $contents = $path;
$path = '/tmp/dparser_' . microtime(); $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'dparser_' . microtime();
file_put_contents($path, $contents); file_put_contents($path, $contents);
} }
include($path); include($path);
$contents = ob_get_clean(); $contents = ob_get_clean();
return $contents; return $contents;
} }
public function doDump($data, $path) public function doDump($data, $path)
{ {
if ($path) { if ($path) {
...@@ -139,4 +139,4 @@ abstract class Doctrine_Parser ...@@ -139,4 +139,4 @@ abstract class Doctrine_Parser
return $data; return $data;
} }
} }
} }
\ No newline at end of file
...@@ -248,7 +248,7 @@ UserProfile: ...@@ -248,7 +248,7 @@ UserProfile:
sorting: ASC sorting: ASC
length: 10 length: 10
primary: true primary: true
last_name: ~ last_name: []
type: unique type: unique
</code> </code>
...@@ -273,4 +273,4 @@ $options = array('packagesPrefix' => 'Package', // What to p ...@@ -273,4 +273,4 @@ $options = array('packagesPrefix' => 'Package', // What to p
// This code will generate the models for schema.yml at /path/to/generate/models // This code will generate the models for schema.yml at /path/to/generate/models
Doctrine::generateModelsFromYaml('schema.yml', '/path/to/generate/models', $options); Doctrine::generateModelsFromYaml('schema.yml', '/path/to/generate/models', $options);
</code> </code>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment