1
0
mirror of synced 2024-12-13 14:56:01 +03:00

[2.0] Updating Symfony Yaml component to PHP 5.3 version

This commit is contained in:
jwage 2010-03-16 23:03:29 +00:00
parent a25c704246
commit e06f7c981d
5 changed files with 9 additions and 35 deletions

View File

@ -24,13 +24,6 @@ namespace Doctrine\ORM\Mapping\Driver;
use Doctrine\ORM\Mapping\ClassMetadataInfo,
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.
*
@ -434,6 +427,6 @@ class YamlDriver extends AbstractFileDriver
*/
protected function _loadMappingFile($file)
{
return \sfYaml::load($file);
return \Symfony\Components\Yaml\Yaml::load($file);
}
}

View File

@ -180,17 +180,10 @@ class ConvertMappingTask extends AbstractTask
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');
if ($files) {
$array = \sfYaml::load($files[0]);
$array = \Symfony\Components\Yaml\Yaml::load($files[0]);
$first = current($array);
// We're dealing with a Doctrine 1 schema if you have

View File

@ -25,13 +25,6 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo,
Doctrine\ORM\Tools\Export\Driver\AbstractExporter,
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
*
@ -76,10 +69,10 @@ class ConvertDoctrine1Schema
if (is_dir($path)) {
$files = glob($path . '/*.yml');
foreach ($files as $file) {
$schema = array_merge($schema, (array) \sfYaml::load($file));
$schema = array_merge($schema, (array) \Symfony\Components\Yaml\Yaml::load($file));
}
} else {
$schema = array_merge($schema, (array) \sfYaml::load($path));
$schema = array_merge($schema, (array) \Symfony\Components\Yaml\Yaml::load($path));
}
}

View File

@ -27,13 +27,6 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo,
Doctrine\ORM\Mapping\OneToManyMapping,
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
*
@ -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);
}
}

View File

@ -13,9 +13,11 @@ require_once __DIR__ . '/../../../lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . '/../../../lib/vendor');
$classLoader->register();
set_include_path(
__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib'
. PATH_SEPARATOR .
get_include_path()
);
);