[2.0] Updating Symfony Yaml component to PHP 5.3 version
This commit is contained in:
parent
a25c704246
commit
e06f7c981d
@ -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
|
|||||||
*/
|
*/
|
||||||
protected function _loadMappingFile($file)
|
protected function _loadMappingFile($file)
|
||||||
{
|
{
|
||||||
return \sfYaml::load($file);
|
return \Symfony\Components\Yaml\Yaml::load($file);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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,
|
|||||||
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
|
|||||||
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,
|
|||||||
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
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return \sfYaml::dump(array($metadata->name => $array), 10);
|
return \Symfony\Components\Yaml\Yaml::dump(array($metadata->name => $array), 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user