Commit e06f7c98 authored by jwage's avatar jwage

[2.0] Updating Symfony Yaml component to PHP 5.3 version

parent a25c7042
...@@ -24,13 +24,6 @@ namespace Doctrine\ORM\Mapping\Driver; ...@@ -24,13 +24,6 @@ namespace Doctrine\ORM\Mapping\Driver;
use Doctrine\ORM\Mapping\ClassMetadataInfo, use Doctrine\ORM\Mapping\ClassMetadataInfo,
Doctrine\ORM\Mapping\MappingException; Doctrine\ORM\Mapping\MappingException;
if ( ! class_exists('sfYaml', false)) {
require_once __DIR__ . '/../../../../vendor/sfYaml/sfYaml.class.php';
require_once __DIR__ . '/../../../../vendor/sfYaml/sfYamlDumper.class.php';
require_once __DIR__ . '/../../../../vendor/sfYaml/sfYamlInline.class.php';
require_once __DIR__ . '/../../../../vendor/sfYaml/sfYamlParser.class.php';
}
/** /**
* The YamlDriver reads the mapping metadata from yaml schema files. * The YamlDriver reads the mapping metadata from yaml schema files.
* *
...@@ -434,6 +427,6 @@ class YamlDriver extends AbstractFileDriver ...@@ -434,6 +427,6 @@ class YamlDriver extends AbstractFileDriver
*/ */
protected function _loadMappingFile($file) protected function _loadMappingFile($file)
{ {
return \sfYaml::load($file); return \Symfony\Components\Yaml\Yaml::load($file);
} }
} }
\ No newline at end of file
...@@ -180,17 +180,10 @@ class ConvertMappingTask extends AbstractTask ...@@ -180,17 +180,10 @@ class ConvertMappingTask extends AbstractTask
private function _isDoctrine1Schema(array $from) private function _isDoctrine1Schema(array $from)
{ {
if ( ! class_exists('sfYaml', false)) {
require_once __DIR__ . '/../../../../../vendor/sfYaml/sfYaml.class.php';
require_once __DIR__ . '/../../../../../vendor/sfYaml/sfYamlDumper.class.php';
require_once __DIR__ . '/../../../../../vendor/sfYaml/sfYamlInline.class.php';
require_once __DIR__ . '/../../../../../vendor/sfYaml/sfYamlParser.class.php';
}
$files = glob(current($from) . '/*.yml'); $files = glob(current($from) . '/*.yml');
if ($files) { if ($files) {
$array = \sfYaml::load($files[0]); $array = \Symfony\Components\Yaml\Yaml::load($files[0]);
$first = current($array); $first = current($array);
// We're dealing with a Doctrine 1 schema if you have // We're dealing with a Doctrine 1 schema if you have
......
...@@ -25,13 +25,6 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo, ...@@ -25,13 +25,6 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo,
Doctrine\ORM\Tools\Export\Driver\AbstractExporter, Doctrine\ORM\Tools\Export\Driver\AbstractExporter,
Doctrine\Common\Util\Inflector; Doctrine\Common\Util\Inflector;
if ( ! class_exists('sfYaml', false)) {
require_once __DIR__ . '/../../../vendor/sfYaml/sfYaml.class.php';
require_once __DIR__ . '/../../../vendor/sfYaml/sfYamlDumper.class.php';
require_once __DIR__ . '/../../../vendor/sfYaml/sfYamlInline.class.php';
require_once __DIR__ . '/../../../vendor/sfYaml/sfYamlParser.class.php';
}
/** /**
* Class to help with converting Doctrine 1 schema files to Doctrine 2 mapping files * Class to help with converting Doctrine 1 schema files to Doctrine 2 mapping files
* *
...@@ -76,10 +69,10 @@ class ConvertDoctrine1Schema ...@@ -76,10 +69,10 @@ class ConvertDoctrine1Schema
if (is_dir($path)) { if (is_dir($path)) {
$files = glob($path . '/*.yml'); $files = glob($path . '/*.yml');
foreach ($files as $file) { foreach ($files as $file) {
$schema = array_merge($schema, (array) \sfYaml::load($file)); $schema = array_merge($schema, (array) \Symfony\Components\Yaml\Yaml::load($file));
} }
} else { } else {
$schema = array_merge($schema, (array) \sfYaml::load($path)); $schema = array_merge($schema, (array) \Symfony\Components\Yaml\Yaml::load($path));
} }
} }
......
...@@ -27,13 +27,6 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo, ...@@ -27,13 +27,6 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo,
Doctrine\ORM\Mapping\OneToManyMapping, Doctrine\ORM\Mapping\OneToManyMapping,
Doctrine\ORM\Mapping\ManyToManyMapping; Doctrine\ORM\Mapping\ManyToManyMapping;
if ( ! class_exists('sfYaml', false)) {
require_once __DIR__ . '/../../../../../vendor/sfYaml/sfYaml.class.php';
require_once __DIR__ . '/../../../../../vendor/sfYaml/sfYamlDumper.class.php';
require_once __DIR__ . '/../../../../../vendor/sfYaml/sfYamlInline.class.php';
require_once __DIR__ . '/../../../../../vendor/sfYaml/sfYamlParser.class.php';
}
/** /**
* ClassMetadata exporter for Doctrine YAML mapping files * ClassMetadata exporter for Doctrine YAML mapping files
* *
...@@ -184,6 +177,6 @@ class YamlExporter extends AbstractExporter ...@@ -184,6 +177,6 @@ class YamlExporter extends AbstractExporter
} }
} }
return \sfYaml::dump(array($metadata->name => $array), 10); return \Symfony\Components\Yaml\Yaml::dump(array($metadata->name => $array), 10);
} }
} }
\ No newline at end of file
...@@ -13,9 +13,11 @@ require_once __DIR__ . '/../../../lib/Doctrine/Common/ClassLoader.php'; ...@@ -13,9 +13,11 @@ require_once __DIR__ . '/../../../lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine'); $classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
$classLoader->register(); $classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . '/../../../lib/vendor');
$classLoader->register();
set_include_path( set_include_path(
__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib' __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib'
. PATH_SEPARATOR . . PATH_SEPARATOR .
get_include_path() get_include_path()
); );
\ 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