Julio Montoya 12 жил өмнө
parent
commit
fdaf5ad73f

+ 1 - 1
vendor/autoload.php

@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer' . '/autoload_real.php';
 
-return ComposerAutoloaderInitc7c9a3a13cef03a518ebf5eb9c03a1ac::getLoader();
+return ComposerAutoloaderInit4c36f578e2049a6c5e286a4dec4891cd::getLoader();

+ 0 - 2
vendor/composer/autoload_classmap.php

@@ -549,7 +549,6 @@ return array(
     'Inline_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/inline_frame_reflower.cls.php',
     'Inline_Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/inline_positioner.cls.php',
     'Inline_Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/inline_renderer.cls.php',
-    'Install' => $baseDir . '/main/install/install.class.php',
     'Javascript' => $baseDir . '/main/inc/lib/javascript.class.php',
     'Javascript_Embedder' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/javascript_embedder.cls.php',
     'KeyAuth' => $baseDir . '/main/auth/key/key_auth.class.php',
@@ -565,7 +564,6 @@ return array(
     'List_Bullet_Image_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/list_bullet_image_frame_decorator.cls.php',
     'List_Bullet_Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/list_bullet_positioner.cls.php',
     'List_Bullet_Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/list_bullet_renderer.cls.php',
-    'Log' => $baseDir . '/main/inc/lib/log.class.php',
     'Logger' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/Logger.php',
     'LoggerAppender' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerAppender.php',
     'LoggerAppenderAdodb' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderAdodb.php',

+ 3 - 3
vendor/composer/autoload_real.php

@@ -2,7 +2,7 @@
 
 // autoload_real.php generated by Composer
 
-class ComposerAutoloaderInitc7c9a3a13cef03a518ebf5eb9c03a1ac
+class ComposerAutoloaderInit4c36f578e2049a6c5e286a4dec4891cd
 {
     private static $loader;
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitc7c9a3a13cef03a518ebf5eb9c03a1ac
             return self::$loader;
         }
 
-        spl_autoload_register(array('ComposerAutoloaderInitc7c9a3a13cef03a518ebf5eb9c03a1ac', 'loadClassLoader'));
+        spl_autoload_register(array('ComposerAutoloaderInit4c36f578e2049a6c5e286a4dec4891cd', 'loadClassLoader'));
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        spl_autoload_unregister(array('ComposerAutoloaderInitc7c9a3a13cef03a518ebf5eb9c03a1ac', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInit4c36f578e2049a6c5e286a4dec4891cd', 'loadClassLoader'));
 
         $vendorDir = dirname(__DIR__);
         $baseDir = dirname($vendorDir);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 411 - 278
vendor/composer/installed.json


+ 1 - 1
vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php

@@ -104,7 +104,7 @@ final class Debug
                         $return->__PROXY_INITIALIZED__ = $var->__isInitialized();
                     }
 
-                    if ($var instanceof \ArrayObject) {
+                    if ($var instanceof \ArrayObject || $var instanceof \ArrayIterator) {
                         $return->__STORAGE__ = self::export($var->getArrayCopy(), $maxDepth - 1);
                     }
 

+ 6 - 1
vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php

@@ -25,11 +25,16 @@ class DebugTest extends DoctrineTestCase
         $this->assertEquals( "DateTime", $var->__CLASS__ );
     }
 
-    public function testExportArrayObject()
+    public function testExportArrayTraversable()
     {
         $obj = new \ArrayObject(array('foobar'));
 
         $var = Debug::export($obj, 2);
         $this->assertContains('foobar', $var->__STORAGE__);
+
+        $it = new \ArrayIterator(array('foobar'));
+
+        $var = Debug::export($it, 5);
+        $this->assertContains('foobar', $var->__STORAGE__);
     }
 }

+ 11 - 0
vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php

@@ -46,6 +46,17 @@ class SqlitePlatform extends AbstractPlatform
         return 'RLIKE';
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public function getGuidExpression()
+    {
+        return "HEX(RANDOMBLOB(4)) || '-' || HEX(RANDOMBLOB(2)) || '-4' || "
+            . "SUBSTR(HEX(RANDOMBLOB(2)), 2) || '-' || "
+            . "SUBSTR('89AB', 1 + (ABS(RANDOM()) % 4), 1) || "
+            . "SUBSTR(HEX(RANDOMBLOB(2)), 2) || '-' || HEX(RANDOMBLOB(6))";
+    }
+
     /**
      * {@inheritDoc}
      */

+ 48 - 0
vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL421Test.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace Doctrine\Tests\DBAL\Functional\Ticket;
+
+/**
+ * @group DBAL-421
+ */
+class DBAL421Test extends \Doctrine\Tests\DbalFunctionalTestCase
+{
+    protected function setUp()
+    {
+        parent::setUp();
+
+        $platform = $this->_conn->getDatabasePlatform()->getName();
+        if (!in_array($platform, array('mysql', 'sqlite'))) {
+            $this->markTestSkipped('Currently restricted to MySQL and SQLite.');
+        }
+    }
+
+    public function testGuidShouldMatchPattern()
+    {
+        $guid = $this->_conn->query($this->getSelectGuidSql())->fetchColumn();
+        $pattern = '/[0-9A-F]{8}\-[0-9A-F]{4}\-[0-9A-F]{4}\-[8-9A-B][0-9A-F]{3}\-[0-9A-F]{12}/i';
+        $this->assertEquals(1, preg_match($pattern, $guid), "GUID does not match pattern");
+    }
+
+    /**
+     * This test does (of course) not proof that all generated GUIDs are
+     * random, it should however provide some basic confidence.
+     */
+    public function testGuidShouldBeRandom()
+    {
+        $statement = $this->_conn->prepare($this->getSelectGuidSql());
+        $guids = array();
+        for ($i = 0; $i < 99; $i++)
+        {
+            $statement->execute();
+            $guid = $statement->fetchColumn();
+            $this->assertNotContains($guid, $guids, "Duplicate GUID detected");
+            $guids[] = $guid;
+        }
+    }
+
+    private function getSelectGuidSql()
+    {
+        return "SELECT " . $this->_conn->getDatabasePlatform()->getGuidExpression();
+    }
+}

+ 5 - 5
vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/Repository/TranslationRepository.php

@@ -81,11 +81,11 @@ class TranslationRepository extends EntityRepository
                 $transMeta->getReflectionProperty('objectClass')->setValue($trans, $objectClass);
                 $transMeta->getReflectionProperty('field')->setValue($trans, $field);
                 $transMeta->getReflectionProperty('locale')->setValue($trans, $locale);
-                if ($listener->getDefaultLocale() != $listener->getTranslatableLocale($entity, $meta) &&
-                    $locale === $listener->getDefaultLocale()) {
-                    $listener->setTranslationInDefaultLocale(spl_object_hash($entity), $field, $trans);
-                    $needsPersist = $listener->getPersistDefaultLocaleTranslation();
-                }
+            }
+            if ($listener->getDefaultLocale() != $listener->getTranslatableLocale($entity, $meta) &&
+                $locale === $listener->getDefaultLocale()) {
+                $listener->setTranslationInDefaultLocale(spl_object_hash($entity), $field, $trans);
+                $needsPersist = $listener->getPersistDefaultLocaleTranslation();
             }
             $type = Type::getType($meta->getTypeOfField($field));
             $transformed = $type->convertToDatabaseValue($value, $this->_em->getConnection()->getDatabasePlatform());

+ 59 - 2
vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/TranslatableListener.php

@@ -3,6 +3,7 @@
 namespace Gedmo\Translatable;
 
 use Doctrine\Common\EventArgs;
+use Doctrine\ORM\ORMInvalidArgumentException;
 use Gedmo\Tool\Wrapper\AbstractWrapper;
 use Gedmo\Mapping\MappedEventSubscriber;
 use Gedmo\Translatable\Mapping\Event\TranslatableAdapter;
@@ -122,6 +123,7 @@ class TranslatableListener extends MappedEventSubscriber
         return array(
             'postLoad',
             'postPersist',
+            'preFlush',
             'onFlush',
             'loadClassMetadata'
         );
@@ -307,6 +309,43 @@ class TranslatableListener extends MappedEventSubscriber
         return $locale;
     }
 
+    /**
+     * Handle translation changes in default locale
+     *
+     * This has to be done in the preFlush because, when an entity has been loaded
+     * in a different locale, no changes will be detected.
+     *
+     * @param EventArgs $args
+     * @return void
+     */
+    public function preFlush(EventArgs $args)
+    {
+        $ea = $this->getEventAdapter($args);
+        $om = $ea->getObjectManager();
+        $uow = $om->getUnitOfWork();
+
+        foreach ($this->translationInDefaultLocale as $oid => $fields) {
+            $trans = reset($fields);
+            if ($ea->usesPersonalTranslation(get_class($trans))) {
+                $entity = $trans->getObject();
+            } else {
+                $entity = $uow->tryGetById($trans->getForeignKey(), $trans->getObjectClass());
+            }
+
+            if (!$entity) {
+                continue;
+            }
+
+            try {
+                $uow->scheduleForUpdate($entity);
+            } catch (ORMInvalidArgumentException $e) {
+                foreach ($fields as $field => $trans) {
+                    $this->removeTranslationInDefaultLocale($oid, $field);
+                }
+            }
+        }
+    }
+
     /**
      * Looks for translatable objects being inserted or updated
      * for further processing
@@ -490,7 +529,7 @@ class TranslatableListener extends MappedEventSubscriber
         foreach ($translatableFields as $field) {
             $wasPersistedSeparetely = false;
             $skip = isset($this->translatedInLocale[$oid]) && $locale === $this->translatedInLocale[$oid];
-            $skip = $skip && !isset($changeSet[$field]);
+            $skip = $skip && !isset($changeSet[$field]) && !$this->getTranslationInDefaultLocale($oid, $field);
             if ($skip) {
                 continue; // locale is same and nothing changed
             }
@@ -597,10 +636,16 @@ class TranslatableListener extends MappedEventSubscriber
             if ($locale !== $this->defaultLocale) {
                 $ea->clearObjectChangeSet($uow, $oid);
                 // recompute changeset only if there are changes other than reverted translations
-                if ($modifiedChangeSet) {
+                if ($modifiedChangeSet || $this->hasTranslationsInDefaultLocale($oid)) {
                     foreach ($modifiedChangeSet as $field => $changes) {
                         $ea->setOriginalObjectProperty($uow, $oid, $field, $changes[0]);
                     }
+                    foreach ($translatableFields as $field) {
+                        if ($this->getTranslationInDefaultLocale($oid, $field) !== null) {
+                            $wrapped->setPropertyValue($field, $this->getTranslationInDefaultLocale($oid, $field)->getContent());
+                            $this->removeTranslationInDefaultLocale($oid, $field);
+                        }
+                    }
                     $ea->recomputeSingleObjectChangeset($uow, $meta, $object);
                 }
             }
@@ -665,4 +710,16 @@ class TranslatableListener extends MappedEventSubscriber
         }
         return $ret;
     }
+
+    /**
+     * Check if object has any translation object which represents translation in default language.
+     * This is for internal use only.
+     *
+     * @param    string    $oid   hash of the basic entity
+     * @return   bool
+     */
+    public function hasTranslationsInDefaultLocale($oid)
+    {
+        return array_key_exists($oid, $this->translationInDefaultLocale);
+    }
 }

+ 62 - 0
vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/TranslatableEntityDefaultTranslationTest.php

@@ -146,6 +146,68 @@ class TranslatableEntityDefaultTranslationTest extends BaseTestCaseORM
         $this->assertEquals('title defaultLocale', $articles[0]['title']);
     }
 
+    function testUpdateTranslationInDefaultLocale()
+    {
+        $this->translatableListener->setPersistDefaultLocaleTranslation( false );
+        $entity = new Article;
+        $this->repo
+            ->translate($entity, 'title', 'defaultLocale'   , 'title defaultLocale'   )
+            ->translate($entity, 'title', 'translatedLocale', 'title translatedLocale');
+
+        $this->em->persist($entity);
+        $this->em->flush();
+        $this->em->clear();
+
+        $entity = $this->em->find(self::ARTICLE, 1);
+        $entity->setTranslatableLocale('translatedLocale');
+        $this->em->refresh($entity);
+
+        $this->repo
+             ->translate($entity, 'title', 'defaultLocale', 'update title defaultLocale');
+
+        $this->em->flush();
+
+        $qb = $this->em->createQueryBuilder('a');
+        $qb->select('a')
+           ->from(self::ARTICLE, 'a')
+           ->where('a.id = 1');
+
+        $fields = $qb->getQuery()->getArrayResult();
+
+        $this->assertEquals( 'update title defaultLocale', $fields[0]['title']);
+    }
+
+    function testUpdateTranslationWithPersistingInDefaultLocale()
+    {
+        $this->translatableListener->setPersistDefaultLocaleTranslation( true );
+        $entity = new Article;
+        $this->repo
+            ->translate($entity, 'title', 'defaultLocale'   , 'title defaultLocale'   )
+            ->translate($entity, 'title', 'translatedLocale', 'title translatedLocale');
+
+        $this->em->persist($entity);
+        $this->em->flush();
+        $this->em->clear();
+
+        $entity = $this->em->find(self::ARTICLE, 1);
+        $entity->setTranslatableLocale('translatedLocale');
+        $this->em->refresh($entity);
+
+        $this->repo
+             ->translate($entity, 'title', 'defaultLocale', 'update title defaultLocale');
+
+        $this->em->flush();
+
+        $qb = $this->em->createQueryBuilder('a');
+        $qb->select('a')
+           ->from(self::ARTICLE, 'a')
+           ->where('a.id = 1');
+
+        $fields = $qb->getQuery()->getArrayResult();
+
+        $this->assertEquals( 'update title defaultLocale', $fields[0]['title']);
+    }
+
     /**
      * As this test does not provide a default translation, we assert
      * that a translated value is picked as default value

+ 2 - 1
vendor/silex/silex/src/Silex/Util/Compiler.php

@@ -82,7 +82,8 @@ class Compiler
 
         $phar->stopBuffering();
 
-        // $phar->compressFiles(\Phar::GZ);
+        // FIXME: phar compression feature is not yet implemented
+        //$phar->compressFiles(\Phar::GZ);
 
         unset($phar);
     }

+ 5 - 0
vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php

@@ -20,6 +20,11 @@ use Symfony\Component\Console\Output\StreamOutput;
 /**
  * Eases the testing of console applications.
  *
+ * When testing an application, don't forget to disable the auto exit flag:
+ *
+ *     $application = new Application();
+ *     $application->setAutoExit(false);
+ *
  * @author Fabien Potencier <fabien@symfony.com>
  */
 class ApplicationTester

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно