Commit a9f1dfe4 authored by webchick's avatar webchick

Issue #2157045 by dawehner: Update doctrine/common to 2.5-dev.

parent a3d88883
......@@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
"hash": "414745173d1e926721e1d7511a65dcec",
"hash": "c0c7604f8c0ed6b60809dfe98015e8b8",
"packages": [
{
"name": "doctrine/annotations",
......@@ -207,16 +207,16 @@
},
{
"name": "doctrine/common",
"version": "2.4.0-RC4",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common.git",
"reference": "2.4.0-RC4"
"reference": "ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/2.4.0-RC4",
"reference": "2.4.0-RC4",
"url": "https://api.github.com/repos/doctrine/common/zipball/ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0",
"reference": "ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0",
"shasum": ""
},
"require": {
......@@ -230,7 +230,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4.x-dev"
"dev-master": "2.5.x-dev"
}
},
"autoload": {
......@@ -246,7 +246,8 @@
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/"
"homepage": "http://www.jwage.com/",
"role": "Creator"
},
{
"name": "Guilherme Blanco",
......@@ -262,9 +263,9 @@
"email": "kontakt@beberlei.de"
},
{
"name": "Johannes M. Schmitt",
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
......@@ -277,7 +278,7 @@
"persistence",
"spl"
],
"time": "2013-06-21 12:11:28"
"time": "2013-12-03 21:02:18"
},
{
"name": "doctrine/inflector",
......@@ -2056,7 +2057,7 @@
],
"minimum-stability": "stable",
"stability-flags": {
"doctrine/common": 10,
"doctrine/common": 20,
"doctrine/annotations": 20,
"kriswallsmith/assetic": 15,
"symfony-cmf/routing": 15,
......
......@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInite23e221879b77f56988466576fc63488::getLoader();
return ComposerAutoloaderInit0fa08cab46efc8ac2870c28f0a4fd5aa::getLoader();
......@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInite23e221879b77f56988466576fc63488
class ComposerAutoloaderInit0fa08cab46efc8ac2870c28f0a4fd5aa
{
private static $loader;
......@@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInite23e221879b77f56988466576fc63488', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit0fa08cab46efc8ac2870c28f0a4fd5aa', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInite23e221879b77f56988466576fc63488', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit0fa08cab46efc8ac2870c28f0a4fd5aa', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
......
......@@ -932,82 +932,6 @@
"string"
]
},
{
"name": "doctrine/common",
"version": "2.4.0-RC4",
"version_normalized": "2.4.0.0-RC4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common.git",
"reference": "2.4.0-RC4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/2.4.0-RC4",
"reference": "2.4.0-RC4",
"shasum": ""
},
"require": {
"doctrine/annotations": "1.*",
"doctrine/cache": "1.*",
"doctrine/collections": "1.*",
"doctrine/inflector": "1.*",
"doctrine/lexer": "1.*",
"php": ">=5.3.2"
},
"time": "2013-06-21 12:11:28",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Doctrine\\Common\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": "http://www.instaclick.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Common Library for Doctrine projects",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"annotations",
"collections",
"eventmanager",
"persistence",
"spl"
]
},
{
"name": "guzzle/common",
"version": "v3.7.1",
......@@ -2116,5 +2040,82 @@
"docblock",
"parser"
]
},
{
"name": "doctrine/common",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common.git",
"reference": "ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0",
"reference": "ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0",
"shasum": ""
},
"require": {
"doctrine/annotations": "1.*",
"doctrine/cache": "1.*",
"doctrine/collections": "1.*",
"doctrine/inflector": "1.*",
"doctrine/lexer": "1.*",
"php": ">=5.3.2"
},
"time": "2013-12-03 21:02:18",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Doctrine\\Common\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/",
"role": "Creator"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": "http://www.instaclick.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Common Library for Doctrine projects",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"annotations",
"collections",
"eventmanager",
"persistence",
"spl"
]
}
]
......@@ -5,3 +5,5 @@ dist/
tests/Doctrine/Tests/Common/Proxy/generated/
vendor/
.idea
doctrine-common-*.tar
doctrine-common-*.tar.gz
language: php
env:
- OPCODE_CACHE=apc
php:
- 5.3.3
- 5.3
......@@ -11,4 +8,3 @@ php:
before_script:
- composer --prefer-source install
- php ./bin/travis-setup.php $OPCODE_CACHE
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
/**
* Install PHP extensions required for testing by Travis CI.
*
* @author Victor Berchet <victor@suumit.com>
* @since 2.2
*/
$installer = new PhpExtensions();
if (isset($argv[1]) && 'APC' === strtoupper($argv[1])) {
$installer->install('apc');
} else {
$installer->install('xcache');
}
$installer->install('memcache');
$installer->install('memcached');
class PhpExtensions
{
protected $extensions;
protected $phpVersion;
protected $iniPath;
public function __construct()
{
$this->phpVersion = phpversion();
$this->iniPath = php_ini_loaded_file();
$this->extensions = array(
'memcache' => array(
'url' => 'http://pecl.php.net/get/memcache-2.2.6.tgz',
'php_version' => array(),
'cfg' => array('--enable-memcache'),
'ini' => array('extension=memcache.so'),
),
'memcached' => array(
'url' => 'http://pecl.php.net/get/memcached-1.0.2.tgz',
'php_version' => array(
// memcached 1.0.2 does not build on PHP 5.4
array('<', '5.4'),
),
'cfg' => array(),
'ini' => array('extension=memcached.so'),
),
'apc' => array(
'url' => 'http://pecl.php.net/get/APC-3.1.9.tgz',
'php_version' => array(
// apc 3.1.9 causes a segfault on PHP 5.4
array('<', '5.4'),
),
'cfg' => array(),
'ini' => array(
'extension=apc.so',
'apc.enabled=1',
'apc.enable_cli=1'
),
),
'xcache' => array(
'url' => 'http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz',
'php_version' => array(
// xcache does not build with Travis CI (as of 2012-01-09)
array('<', '5'),
),
'cfg' => array('--enable-xcache'),
'ini' => array(
'extension=xcache.so',
'xcache.cacher=false',
'xcache.admin.enable_auth=0',
'xcache.var_size=1M',
),
),
);
}
public function install($name)
{
if (array_key_exists($name, $this->extensions)) {
$extension = $this->extensions[$name];
echo "== extension: $name ==\n";
foreach ($extension['php_version'] as $version) {
if (!version_compare($this->phpVersion, $version[1], $version[0])) {
printf(
"=> not installed, requires a PHP version %s %s (%s installed)\n",
$version[0],
$version[1],
$this->phpVersion
);
return;
}
}
$this->system(sprintf("wget %s > /dev/null 2>&1", $extension['url']));
$file = basename($extension['url']);
$this->system(sprintf("tar -xzf %s > /dev/null 2>&1", $file));
$folder = basename($file, ".tgz");
$folder = basename($folder, ".tar.gz");
$this->system(sprintf(
'sh -c "cd %s && phpize && ./configure %s && make && sudo make install" > /dev/null 2>&1',
$folder,
implode(' ', $extension['cfg'])
));
foreach ($extension['ini'] as $ini) {
$this->system(sprintf("echo %s >> %s", $ini, $this->iniPath));
}
printf("=> installed (%s)\n", $folder);
}
}
private function system($cmd)
{
$ret = 0;
system($cmd, $ret);
if (0 !== $ret) {
printf("=> Command '%s' failed !", $cmd);
exit($ret);
}
}
}
# Project Name
project.name=DoctrineCommon
# Version class and file
project.version_class = Doctrine\Common\Version
project.version_class = Doctrine\\Common\\Version
project.version_file = lib/Doctrine/Common/Version.php
<?xml version="1.0"?>
<project name="Doctrine2" default="build" basedir=".">
<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
<import file="${project.basedir}/lib/vendor/doctrine-build-common/packaging.xml" />
<project name="DoctrineCommon" default="build" basedir=".">
<property file="build.properties" />
<!--
Fileset for artifacts shared across all distributed packages.
-->
<fileset id="shared-artifacts" dir=".">
<include name="LICENSE"/>
<include name="COPYRIGHT"/>
<include name="CHANGELOG"/>
</fileset>
<!--
Fileset for the sources of the Doctrine Common package.
-->
<fileset id="common-sources" dir="./lib">
<include name="Doctrine/Common/**"/>
</fileset>
<!--
Builds Common package, preparing it for distribution.
-->
<target name="copy-files" depends="prepare">
<copy todir="${build.dir}/${project.name}-${version}">
<fileset refid="shared-artifacts"/>
</copy>
<copy todir="${build.dir}/${project.name}-${version}">
<fileset refid="common-sources"/>
</copy>
</target>
<!--
Builds distributable PEAR packages.
-->
<target name="define-pear-package" depends="copy-files">
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${project.name}-${version}">
<name>DoctrineCommon</name>
<summary>Doctrine Common PHP Extensions</summary>
<channel>pear.doctrine-project.org</channel>
<description>The Doctrine Common package contains shared code between the other packages.</description>
<lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
<lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" />
<lead user="romanb" name="Roman Borschel" email="roman@code-factory.org" />
<lead user="beberlei" name="Benjamin Eberlei" email="kontakt@beberlei.de" />
<license>MIT</license>
<version release="${pear.version}" api="${pear.version}" />
<stability release="${pear.stability}" api="${pear.stability}" />
<notes>-</notes>
<dependencies>
<php minimum_version="5.3.0" />
<pear minimum_version="1.6.0" recommended_version="1.6.1" />
</dependencies>
</d51pearpkg2>
<target name="php">
<exec executable="which" outputproperty="php_executable">
<arg value="php" />
</exec>
</target>
<target name="prepare">
<mkdir dir="build" />
</target>
<target name="build" depends="check-git-checkout-clean,prepare,php,composer">
<exec executable="${php_executable}">
<arg value="build/composer.phar" />
<arg value="archive" />
<arg value="--dir=build" />
</exec>
</target>
<target name="composer" depends="php,composer-check,composer-download">
<exec executable="${php_executable}">
<arg value="build/composer.phar" />
<arg value="install" />
</exec>
</target>
<target name="composer-check" depends="prepare">
<available file="build/composer.phar" property="composer.present"/>
</target>
<target name="composer-download" unless="composer.present">
<exec executable="wget">
<arg value="-Obuild/composer.phar" />
<arg value="http://getcomposer.org/composer.phar" />
</exec>
</target>
<target name="make-release" depends="check-git-checkout-clean,prepare,php">
<replace file="${project.version_file}" token="-DEV" value="" failOnNoReplacements="true" />
<exec executable="${php_executable}" outputproperty="doctrine.current_version" failonerror="true">
<arg value="-r" />
<arg value="require_once '${project.version_file}';echo ${project.version_class}::VERSION;" />
</exec>
<exec executable="${php_executable}" outputproperty="doctrine.next_version" failonerror="true">
<arg value="-r" />
<arg value="$parts = explode('.', str_ireplace(array('-DEV', '-ALPHA', '-BETA'), '', '${doctrine.current_version}'));
if (count($parts) != 3) {
throw new \InvalidArgumentException('Version is assumed in format x.y.z, ${doctrine.current_version} given');
}
$parts[2]++;
echo implode('.', $parts);
" />
</exec>
<git-commit file="${project.version_file}" message="Release ${doctrine.current_version}" />
<git-tag version="${doctrine.current_version}" />
<replace file="${project.version_file}" token="${doctrine.current_version}" value="${doctrine.next_version}-DEV" />
<git-commit file="${project.version_file}" message="Bump version to ${doctrine.next_version}" />
</target>
<target name="check-git-checkout-clean">
<exec executable="git" failonerror="true">
<arg value="diff-index" />
<arg value="--quiet" />
<arg value="HEAD" />
</exec>
</target>
<macrodef name="git-commit">
<attribute name="file" default="NOT SET"/>
<attribute name="message" default="NOT SET"/>
<sequential>
<exec executable="git">
<arg value="add" />
<arg value="@{file}" />
</exec>
<exec executable="git">
<arg value="commit" />
<arg value="-m" />
<arg value="@{message}" />
</exec>
</sequential>
</macrodef>
<macrodef name="git-tag">
<attribute name="version" default="NOT SET" />
<sequential>
<exec executable="git">
<arg value="tag" />
<arg value="-m" />
<arg value="v@{version}" />
<arg value="v@{version}" />
</exec>
</sequential>
</macrodef>
</project>
......@@ -25,7 +25,10 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.4.x-dev"
"dev-master": "2.5.x-dev"
}
},
"archive": {
"exclude": ["!vendor", "tests", "*phpunit.xml", ".travis.yml", "build.xml", "build.properties", "composer.phar"]
}
}
......@@ -127,7 +127,7 @@ public function removeEventListener($events, $listener)
}
/**
* Adds an EventSubscriber. The subscriber is asked for all the events he is
* Adds an EventSubscriber. The subscriber is asked for all the events it is
* interested in and added as a listener for these events.
*
* @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
......
......@@ -30,7 +30,7 @@
interface ObjectManager
{
/**
* Finds a object by its identifier.
* Finds an object by its identifier.
*
* This is just a convenient shortcut for getRepository($className)->find($id).
*
......
......@@ -21,6 +21,7 @@
use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
use Doctrine\Common\Proxy\Exception\InvalidArgumentException;
use Doctrine\Common\Proxy\Exception\OutOfBoundsException;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
......@@ -31,6 +32,43 @@
*/
abstract class AbstractProxyFactory
{
/**
* Never autogenerate a proxy and rely that it was generated by some
* process before deployment.
*
* @var integer
*/
const AUTOGENERATE_NEVER = 0;
/**
* Always generates a new proxy in every request.
*
* This is only sane during development.
*
* @var integer
*/
const AUTOGENERATE_ALWAYS = 1;
/**
* Autogenerate the proxy class when the proxy file does not exist.
*
* This strategy causes a file exists call whenever any proxy is used the
* first time in a request.
*
* @var integer
*/
const AUTOGENERATE_FILE_NOT_EXISTS = 2;
/**
* Generate the proxy classes using eval().
*
* This strategy is only sane for development, and even then it gives me
* the creeps a little.
*
* @var integer
*/
const AUTOGENERATE_EVAL = 3;
/**
* @var \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
*/
......@@ -54,13 +92,13 @@ abstract class AbstractProxyFactory
/**
* @param \Doctrine\Common\Proxy\ProxyGenerator $proxyGenerator
* @param \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory $metadataFactory
* @param bool $autoGenerate
* @param bool|int $autoGenerate
*/
public function __construct(ProxyGenerator $proxyGenerator, ClassMetadataFactory $metadataFactory, $autoGenerate)
{
$this->proxyGenerator = $proxyGenerator;
$this->metadataFactory = $metadataFactory;
$this->autoGenerate = $autoGenerate;
$this->autoGenerate = (int)$autoGenerate;
}
/**
......@@ -71,6 +109,8 @@ public function __construct(ProxyGenerator $proxyGenerator, ClassMetadataFactory
* @param array $identifier
*
* @return \Doctrine\Common\Proxy\Proxy
*
* @throws \Doctrine\Common\Proxy\Exception\OutOfBoundsException
*/
public function getProxy($className, array $identifier)
{
......@@ -81,6 +121,10 @@ public function getProxy($className, array $identifier)
$proxy = new $fqcn($definition->initializer, $definition->cloner);
foreach ($definition->identifierFields as $idField) {
if (! isset($identifier[$idField])) {
throw OutOfBoundsException::missingPrimaryKeyValue($className, $idField);
}
$definition->reflectionFields[$idField]->setValue($proxy, $identifier[$idField]);
}